在看阮一峰老师的es6入门的里面的解构时
function f() {
console.log('aaa');
}
let [x = f()] = [1];
/*等同于下面这段代码*/
let x;
if ([1][0] === undefined) {
x = f();
} else {
x = [1][0];
}
不太懂这段话该怎么理解,貌似[1][0]是一个number类型的值Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
"[1]"数组 仅含1
"1 "取数组第1位