Posted by: fuckeetow October 11, 2011
javascript array
Login in to Rate this Post:     0       ?        
If it's not about the understanding of array in Javascript.

You don't even need use prototype and add a property to Array which happens to be a function that checks the presence of a value in an array.

You can simply make use the method "indexOf( )" which Array already has.

[2, 3, 4].indexOf(3); // 1
[2, 3, 4].indexOf(1); // -1
Read Full Discussion Thread for this article