If I have an array const a = [1, 2]
and a nested array const nested = [[1,2], [2,3]]
How do I check if array a
is in the nested
?
I tried using the nested.includes(a)
, but it doesn't provide the correct output. And I was thinking stringify the array a
, but read some comments about we should not compare array using stringify.
So what is a proper way to check if an array is in another array?