Hi FE !
Ai
git
前端面试题
前端小tip
  • vite
  • webpack
npm
  • vue2
  • vue3
react
GitHub
Ai
git
前端面试题
前端小tip
  • vite
  • webpack
npm
  • vue2
  • vue3
react
GitHub
  • [9,8,7,6][1,2] 输出什么

[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

Edit this page
最近更新: 2025/6/27 02:24
Contributors: qdleader
qdleader
本站总访问量 129823次 | 本站访客数 12人