function f() {
console.log('aaa');
}
let [x = f()] = [1];
以上代码等价于
let x;
if ([1][0] === undefined) {
x = f();
} else {
x = [1][0];
}
等价的代码中[1][0]是什么意思?,
function f() {
console.log('aaa');
}
let [x = f()] = [1];
以上代码等价于
let x;
if ([1][0] === undefined) {
x = f();
} else {
x = [1][0];
}
等价的代码中[1][0]是什么意思?,