3 ms·
Using objects as a map always bothers me, for instance, someone decides their username should be __proto__, and you end up with broken code: var map = { "_
by jcampbell1 12y ago
Using objects as a map always bothers me, for instance, someone decides their username should be __proto__, and you end up with broken code:
var map = { "__proto__": 1, "a":2 ,"b":3 };
for (var key in map) if(map.hasOwnProperty(key)) {
console.log(map[key]);
}