
批改狀態(tài):合格
老師批語:很簡潔
<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); // 字符串類型的數(shù)組
console.log(age);
console.log(height);
}
</script>
let obj = {
name: "小明",
age: 18,
height: 1.8,
};
// 對象的解構(gòu)
const { name, age, height } = obj;
console.log(name, age, height);
let arr = [1, 2, 3, 4];
console.log(...arr);
// 數(shù)組的解構(gòu);
const [a, b, c, d] = arr;
console.log(a, b, c, d);
微信掃碼
關(guān)注PHP中文網(wǎng)服務(wù)號
QQ掃碼
加入技術(shù)交流群
Copyright 2014-2025 http://ipnx.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號