blackberry / Alice

AliceJS - (A Lightweight Independent CSS Engine) is a micro JavaScript library. For a demo, click the link below.

Home Page:http://blackberry.github.com/Alice/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove Use of new Array() Constructor

boazsender opened this issue · comments

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.

Absolutely... We haven't done a full code review on some of the newest code.