in_array()

This snippet searches an array for a pre-specified element and returns 'true' if it's found, 'false' if it's not found. It functions like the in_array() in PHP.




Over 2000+ free Javascript
at JavaScriptBank.com Website
Sampled by JavaScriptBank.com

var v_array = [ 5, 10, 15, 20, 25];
document.writeln(v_array.in_array(10)); // will return true
document.writeln(v_array.in_array(11)); // will return false