I have an array converted from string using JSON.parse:
list = "625, 632";
list = JSON.parse("["+items_string+"]");
which contains:
Array [ 625, 632 ]
Trying to find a given item in the array JQuery inArray will always return -1
if(jQuery.inArray('625', list) > -1){
//never get here
}
console.log(jQuery.inArray('625', list));
//will print -1
Does anyone knows why?