What does this JS statement mean?
var aa= {},
bb= [{name: 'aa1'},{name: 'aa2'}];
code above.
PHP中文网2017-05-19 10:26:04
is equivalent to
var aa = {};
var bb = [{name: 'aa1'},{name: 'aa2'}];
is equivalent to
var aa;
var bb;
aa = {};
bb = [{name: 'aa1'},{name: 'aa2'}];
Initialize aa as an empty object and bb as an array containing two objects
给我你的怀抱2017-05-19 10:26:04
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