Closed WilliamRandol closed 10 years ago
(for var in array) { ... } loops on the object not the array, if you have added any functions to the Array Prototype these get included in the loop.
(for var in array) { ... }
Simply added the .hasOwnProperty to ensure that the loop is only working on the Array values.
.hasOwnProperty
Thanks!
(for var in array) { ... }
loops on the object not the array, if you have added any functions to the Array Prototype these get included in the loop.Simply added the
.hasOwnProperty
to ensure that the loop is only working on the Array values.