数组 Destructuring Fill
填空题 简单
题目
Fill in 空白到 extract 首先 two 元素到 `首先` and `其次`.
代码
const colors = ["red", "green", "blue"];
___ = colors;
console.log(first, second);
提示
Use 数组 destructuring 语法使用 square brackets.
解释
数组 destructuring 语法 [首先, 其次] = 颜色 extracts 颜色[0] 到 首先 and 颜色[1] 到 其次. 所以 首先 是 "red" and 其次 is "green", and console prints: red green
相关资源
相关课程
- JavaScript 数组
学习关于数组 destructuring.
查阅不认识的术语
新手友好的术语表用大白话解释编程术语——变量、函数、DOM、Promise 等等。
解读错误信息
用大白话解释常见错误——什么意思、为什么发生、如何修复。
动手做项目
通过引导式项目应用所学,含起始代码与解决方案。