Coffeescript `in` operator doesn't work with 2D array -


checking values in 1d arrays works..

coffee> 1 in [1,2] true 

but:

coffee> [1, 1] in [[1, 1], [1, 2]] false 

checking values in 2d arrays doesn't.

am missing something, bug or intended?

javascript not count 2 "equal" arrays equal

[1,1] === [1,1] --> false [1,1] == [1,1] --> false 

so counterintuitive coffeescript you're proposing.

you write own method comparison, or use lodash's isequal() method https://lodash.com/docs#isequal


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -