Remove Use of new Array() Constructor
boazsender opened this issue · comments
Boaz commented
I noticed the use of var elems = new Array(...)
, instead of using the var myArr = []
literal syntax:
https://github.com/blackberry/Alice/blob/master/js/alice.js#L40
The literal syntax is both more readable and more performant. Constructing an array with new Array( length )
does not do anything to improve the speed of reading from or operating on the array.
Laurent Hasson commented
Absolutely... We haven't done a full code review on some of the newest code.