I have an array which is:
[ 4ff023908ed2842c1265d9e4, 4ff0d75c8ed2842c1266099b ]
And I have to find if the following, is inside that array
4ff0d75c8ed2842c1266099b
Here is what I wrote:
Array.prototype.contains = function(k) {
for(p in this)
if(this[p] === k)
return true;
return false;
}
Apparently, it doesn't work properly, or better sometimes it works, but it looks to me blocking. Is there anyone that can check that one?
many thanks