javascript - What does this JS statement mean?
淡淡烟草味
淡淡烟草味 2017-05-19 10:24:04
0
2
525

What does this JS statement mean?

    var aa= {},
        bb= [{name: 'aa1'},{name: 'aa2'}];

code above.

淡淡烟草味
淡淡烟草味

reply all(2)
Ty80

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

给我你的怀抱

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template