I have a multidimensional array, and I'm trying to check if it contains another array. I am using jQuery.inArray function at the moment (I tried Array.prototype but kept getting errors, never used this before).
I am trying to ensure that my parent array does not add the same child array twice
if (jQuery.inArray (new Array (step [0], step [1], r2), unavailArray) == - 1) {
alert (jQuery.inArray (new Array (step [0], step [1], r2), unavailArray));
unavailArray.push (new Array (step [0], step [1], r2));
}
I also tried
jQuery.inArray ("[step [0], step [1], r2]", unavailArray) == - 1
and
jQuery.inArray ([step [0], step [1], r2], unavailArray) == - 1
they all return -1, and when I look at the array, I have
[[630,690,09],[3180,3220,2],[3180,3220,2]]
- .