I am trying to write some code that will check to see if a group of numbers stored in an array exist in an object. With the code I have now it is always returning -1.
function checkHorizonal() {
var x= ['1', '2' ,'3'];
var y= ['4', '5', '6'];
var z= ['7', '8', '9']
console.log(jQuery.inArray(x, squaresClicked));
}
This is the squaresClicked object contents:
Object {1: "1", 2: "-1", 3: "1"}
You can see that the keys 1,2,3 exist but it will return -1.