x
 
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript 数组</h1>
<h2>数组解构</h2>
<p id="demo"></p>
<script>
// 创建一个数组
const numbers = [10, 20, 30, 40, 50, 60, 70];
// 解构
const [a, b, ...rest] = numbers;
// 显示值
document.getElementById("demo").innerHTML =
"<p>a 是 " + a +
"<p>b 是 " + b +
"<p>其余的是 " + rest;
</script>
</body>
</html>