Posted by: fuckeetow October 11, 2011
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
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