JavaScript Snippets

April 12, 2011

// inArray() as like as PHP inArray function
function inArray(needle, theArr){
for(var i=0; i<theArr.length; i++){
if(theArr[i] == needle){
return true;
}
}
return false;
}
Advertisements