juancabrera / demos

Prototypes and demos used in code.juan.me
MIT License
16 stars 1 forks source link

Use array literal for defining a new array #2

Open jtwalters opened 10 years ago

jtwalters commented 10 years ago

In your code I see a lot of:

var myarray = Array();

type statements. This seems like a mistake. Perhaps you meant new Array()?. But, the recommended way to create a new, empty array is using the array literal:

var myarray = new Array(); // ok, but not recommended 
var myarray = []; // recommended
juancabrera commented 10 years ago

@jtwalters thanks for the tip, will replace them.