javascript - how can I force the for .. in to display indexes and not prototype members -
i have array , custom prototype function:
var arr = ['a','b','c'], indexes = []; array.prototype.each = function() {/* code */}; // try iterate using .. in construct:
for (var index in arr) { console.log(index); } in console.log, indexes 0-2 , key "each".
Comments
Post a Comment