老师请检查
来源:2-13 编程练习
慕斯2168053
2021-11-19 16:40:39
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
<script>
// Nodelist对象
const list = document.querySelectorAll('li')
// Map对象
const map = new Map([
['a', 1],
['b', 2]
])
// 在此补充代码
const [li1, li2, li3] = [...list];
console.log(li1, li2, li3); // 获取每个li元素
// console.log(li1.innerHTML, li2.innerHTML, li3.innerHTML); // 获取li中的文字
const [
[, a],
[, b]
] = [...map];
console.log(a, b); // 1, 2
const fn = function() {
// arguments对象
// 在此补充代码
console.log(...arguments); // 1 3
}
fn(1, 3)
</script>
</body>
</html>1回答
好帮手慕小李
2021-11-19
同学你好,方法没问题,棒棒的~
祝学习愉快~