So lets say I\'ve added some prototype methods to the Array class:
Array.prototype.containsKey = function(obj) { for(var key in this) if (key =
You can use JavaScript's hasOwnProperty method to achieve this in the loop, like this:
for(var key in arr) { if (arr.hasOwnProperty(key)) { ... } }
Reference: This YUI blog article.