3 ms·
... Yikes. The advice in this post is unfortunately naive. It's dangerous to allow arbitrary object attribute key content. Some object properties in JavaScri
by dyoo1979 11y ago
... Yikes. The advice in this post is unfortunately naive. It's dangerous to allow arbitrary object attribute key content. Some object properties in JavaScript must be treated as reserved. Allowing arbitrary access to key names has unexpected repercussions. For example, consider "prototype" or "hasOwnProperty" as key names.
See: http://www.devthought.com/2012/01/18/an-object-is-not-a-hash/ http://www.devthought.com/2012/01/18/an-object-is-not-a-hash... for more details.
So I'd +1 jestar_jokin's advice: use code that's been well-tested. The code presented in the original poster's "Hash Tables in Javascript" article does not look robust.