search for: timmeh

Displaying 1 result from an estimated 1 matches for "timmeh".

Did you mean: timmer
2007 Jan 19
7
Prototype.js: Is there an "in_array"-like function?
...onality. It''s an prototype for an Array method called "has": Array.prototype.has = function(needle) { for (var i=0;i<this.length;i++) { if(this[i] == needle){ return true; } } return false; } var someArray = [''jim'', ''marge'', ''timmeh'', ''bob'']; if( someArray.has(''bob'') ) { alert(''found bob'') } Isn''t there something like "has()" in prototype already? I have seen the find / findAll, but the example in the docs are kinda complex for "just t...