js 2d array includes

Solutions on MaxInterview for js 2d array includes by the best coders in the world

showing results for - "js 2d array includes"
Lorenzo
03 Aug 2020
1array.some(row => row.includes(search))
Denise
23 May 2017
1let arr = [[1,3], [1,1]];
2if(arr.some(row => JSON.stringify(row) === JSON.stringify([1,3]))){
3    console.log("arr contains this array")
4} else {
5    console.log("arr doesn't contain array")
6}