>>> 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.
>>> 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.