What is the syntax for indexOf()
to go through a multidimensional array?
For instance:
var x = [];
// do something
x.push([a,b]);
x.indexOf(a) // ??
I want to find 'a
' and do something with 'b
'. But it does not work... As this method should be iterative itself, I do not presume using any other iteration would be a good thing to do. Currently I simulate this using 2 simple arrays but I guess this should somehow work too...