jQuery - find matched array value by Norlihazmey Ghazali
jQuery - find matched array value by Norlihazmey Ghazali
http://stackoverflow.com/questions/32449096/checking-if-condition-with-javascript-variables/32449126#32449126
JavaScript
var shortListed = ["Mr. Andrew Severinsen", "Ms. Samantha Smithson-Biggs", "Mr. Tom Herron", "Mr. Efrem Bonfiglioli", "Mr. Giles Forster"];
alert('My type is :'+ $.type(shortListed));
alert('Found Mr. Tom Herron at index :' +$.inArray('Mr. Tom Herron',shortListed));
if ( $.inArray('Mr. Tom Herron',shortListed) !== -1 ) {
alert('Found it');
}