Hacker News new | comments | show | ask | jobs | submit login

I agree with this quote from the link:

>>> Moreover building a hash over an Array object is potentially dangerous. If anyone extends Array.prototype with enumerable properties (as, for example, the Prototype.js library does) these will be read in during for…in iterations, wreaking havoc with your logic (or at least requiring you to make use of the clunky hasOwnProperty method). Build hashes over Object and nothing else, since by convention Object.prototype is not augmented.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact