JavaScript arrays braces vs brackets -


what difference between each of following array definitions.

var myarray = []; var myarray = {}; var myarray = new array(); 

the first , third equivalent , create new array. second creates new empty object, not array.

var myarray = []; //create new array var myarray = {}; //creates **a new empty object** var myarray = new array(); //create new array 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -