[code]
function inArray(needle, haystack) {
var length = haystack.length;
for(var i = 0; i < length; i++) {
if(haystack[i] == needle) return true;
}
return false;
}
[/code]
via JavaScript equivalent of PHP’s in_array() – Stack Overflow.
JavaScript equivalent of PHP's in_array() – Stack Overflow
Related Articles
August 25, 2020
Hello world!
December 21, 2011
Well I lost all my posts… but oh well.
December 21, 2011