These codes don't work:
const a = [[1, 1], [2, 2]]
console.log(a.includes([1, 1])); // --> false
console.log(a.indexOf([1, 1])); // --> -1
This work but I think its not optimized
console.log(a.map(x => x.toString()).includes([1, 1].toString()));
// --> true
Is there a simpler way ?
[1, 1]are the same reference in memory, then you can find your result using the first two methods)JSON.stringify(a).includes('[1,1]')a.join(".").indexOf([1, 1])for optimized solution