How to know if there is an specific array inside an array of arrays

Viewed 22

With this snippet I expected has0Array and has1Array to be true.

const combinations = [
  [0],
  [1]
]

const has0Array = combinations.some((e) => e === [0])
const has1Array = combinations.some((e) => e === [1])

console.log('has0Array', has0Array, 'has1Array', has1Array)

0 Answers
Related