What’s the difference between “{}” and “[]” while declaring a JavaScript array? Normally I declare like
var a=[];
What is the meaning of de
they are two different things..
[] is declaring an Array:
given, a list of elements held by numeric index.
{} is declaring a new object:
given, an object with fields with Names and type+value,
some like to think of it as "Associative Array".
but are not arrays, in their representation.
You can read more @ This Article