I know this is simple but for some reason i am unable to make this work i do not know what i am doing wrong. anyways the purpose for this code is to give an alert box when the element exists inside the array, names
$(doucment).ready(function () {
var names = ["peter", "John", "mary"];
if (jQuery.inArray("mary", names)) {
alert('found');
}
});