求教這種JS宣告是宣告意思?
var aa= {},
bb= [{name: 'aa1'},{name: 'aa2'}];
程式碼以上。
PHP中文网2017-05-19 10:26:04
等價於
var aa = {};
var bb = [{name: 'aa1'},{name: 'aa2'}];
等價於
var aa;
var bb;
aa = {};
bb = [{name: 'aa1'},{name: 'aa2'}];
給 aa 初始化為一個空對象,給 bb 初始化為一個數組,含有兩個對象