Take the 2-minute tour ×  i want to check if "foo" exist on the
array named "Array", but $.inArray return always -1 why ? and
how to solve it ?  Here is my code (also on jsFiddle
http://jsfiddle.net/RochesterFox/B5yF2/4/) :  var Array = []
if($.inArray('fuu',Array) != -1) alert('present'); else
alert('absent');  Thanks !  share|improve this question You
shouldn't have an Array named Array. –  m90 Sep 29 '12 at 15:40
An array should NOT be named as Array. –  Dev Sep 29 '12 at
15:40 Answers are already given, so I will add mine as a comment
here. See jsfiddle.net/B5yF2/6 for a fix to your code with
explanatory comments. –  Ray Toal Sep 29 '12 at 15:48  2 Answers
2  up vote 2 down vote accepted  'fuu' is not actually in the
array, it's a value of an object inside of the array. I'm afraid
that you need a more complex check. I would also not use Array
as the variable name as that's the name of the Array object, but
apparently it's not a reserved word? not sure.  var arr = [];
var found = false; $.each(arr, functio