0

[0, 1].includes(1) //returns true but [[0], [1]].includes([1]) //returns false

Why is this? (This is my first post, please be nice)

Delta Kapp
  • 677
  • 1
  • 4
  • 7
  • 1
    Separate arrays won't be `===` to each other. Hopefully we'll eventually be able to use [`.equals`](https://stackoverflow.com/a/63590182), but until then, you'll have to iterate through each element. – CertainPerformance Nov 24 '20 at 00:21
  • Use `console.log([0, 1]) ` and `console.log([[0], [1]]) ` in your browser, hint: indexes. ︀ – John Nov 24 '20 at 02:43

0 Answers0