Correcting teacher:天蓬老师
Correction status:qualified
Teacher's comments:很简洁
<script>
let name = "张三"; let age = 18; let height = 1.8; const man = `姓名:${name}
,年龄:${age},身高:${height}`; console.log(man);
</script>
<script>
let name = "张三";
let age = 18;
let height = 1.8;
test`姓名:${name},年龄:${age},身高:${height}`;
function test(str, age, height) {
console.log(str); // 字符串类型的数组
console.log(age);
console.log(height);
}
</script>
let obj = {
name: "小明",
age: 18,
height: 1.8,
};
// 对象的解构
const { name, age, height } = obj;
console.log(name, age, height);
let arr = [1, 2, 3, 4];
console.log(...arr);
// 数组的解构;
const [a, b, c, d] = arr;
console.log(a, b, c, d);