1. New Prototype for Array Object()  |
| |
I have spent the past few weeks coming up with custom methods to extend the Array Object(), listed below.
Array.prototype.unique
Array.prototype.shuffle
Array.prototype.common
Array.prototype.uncommon
Array.prototype.find
Array.prototype.findProp
Array.prototype.exist (NEW)
Download Array.prototype sample
During past weeks of scripting, i notice that for..in loops are faster than while and for loops, as for..in loops dont include an incremental value (i++/i--). However they can be generally slower when it come to large arrays.
While loops are generally faster than for loops base on the fact that subtraction (i--) is faster than addition (i++). |
| |
| updated on 22 June 2007 |
| |
| |
| |