What does this JS statement mean?
var aa= {}, bb= [{name: 'aa1'},{name: 'aa2'}];
code above.
is equivalent to
var aa = {}; var bb = [{name: 'aa1'},{name: 'aa2'}];
var aa; var bb; aa = {}; bb = [{name: 'aa1'},{name: 'aa2'}];
Initialize aa as an empty object and bb as an array containing two objects
Declare that aa is an empty object, bb is an array, and there are two objects in the array whose attributes are name and whose values are aa1 and aa2 respectively
is equivalent to
is equivalent to
Initialize aa as an empty object and bb as an array containing two objects
Declare that aa is an empty object, bb is an array, and there are two objects in the array whose attributes are name and whose values are aa1 and aa2 respectively