I have 2 arrays X and Y:
X= [['a', 'b', 'c'], ['d', 'e', 'f']]
Y= [['a', 'x', 'c'], ['y', 'z', 'c']]
In reality X has hundreds of elements.
How can I know the INDEXES of X elements that have a and c in the 1st and 3rd position which are respectively
Y[0][0]
andY[0][2]
?
I have tried combining methods findIndex()
, toString()
and indexOf()
but I am not getting the result I expect.
It still gives results even if it finds SALE while I search SALES.