Brian Chia
       
 
categories
actionscript (23)
actionscript 1.0 (1)
actionscript 2.0 (18)
actionscript 3.0 (1)
misc (3)
 
processing (2)
 
links
brian chia
kelvin zhao
ronald leong
 
 
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
 
 
 
 
         
  © copyright 2007 THINKLUNATIC.    
Brian Chia Jonathan Ng