var x = new Array(10);
$.inArray(10,x);
#Returns -1
I've come across this weird issue, checking a value in an array with $.inArray, really simple.
But, if the array only has one value in it, inArray returns -1.
If I add another value to the array, it works as expected.
This only happens with integers and not with strings.
What's going on?!
console.log( x )2. check empty array in console