[9,8,7,6][1,2] 输出什么
// Example 1
const z = (1,2,3,4,5);
console.log(z); // outputs 5
// Example 2
function a() {
return 'a';
}
function b() {
return 'b';
}
function c() {
return 'c';
}
const d = (a(), b(), c());
console.log(d); // Outputs 'c'
[9,8,7,6][1,2] 即变成
[9,8,7,6][2] which is straightforward, we are trying to access the element at 2 index, which is 7. 所以 答案是 7
更多例子
[9,8,7,6][1,2,3] // outputs 6 [9,8,7,6][8,2,3,1] // outputs 8