I am trying to see if a particular pair of numbers exist in an array. I know that .some() works effectively when it's a simple array, but I can't seem to get it to work in nested arrays.
Thank you in advance.
const array = [[1, 0], [2, 0], [3, 1], [4, 3], [5, 2]];
// checks whether an element exists
const exists = (i) => i == [3, 1] || [1, 3];
console.log(array.some(exists));
// expected output: true