Welcome,
I need to find whether array contains array
I tried two ways(indexOf
and includes
),but both returns a negative result.
let myarray = [
[4, 2],
[2, 2],
[2, 2],
[2, 4],
[2, 2],
];
console.log(myarray.includes([4, 2]));//Returns false
console.log(myarray.indexOf([4, 2]));//Returns -1
I then thought of having a foreach loop,and checking the array(using ==
),
But for that even console.log([4, 2]==[4, 2]);//Returns false
Please Help-I know this is simple for you,