请老师检查

来源:2-13 编程练习

慕UI4313976

2021-10-17 15:22:54

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<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');
        // 在此补充代码
        const [a,b,c] = [...list];
        console.log(a,b,c);
        for(const dom of list){
          console.log(dom);
        }
        // Map对象
        const map = new Map([
            ['a', 1],
            ['b', 2]
        ])
        // 在此补充代码
        const [[k1,v1],[k2,v2]] = [...map];
        console.log(k1,v1,k2,v2);
        for(const item of map){
          console.log(item);
        }
        const fn = function() {
            // arguments对象
            // 在此补充代码
            console.log([x,y] = [...arguments]);
            for(const arg of arguments){
              console.log(arg);
            }
        }
        fn(1, 3)
</script>
</body>

</html>


写回答

1回答

好帮手慕慕子

2021-10-17

同学你好,代码实现是对的,很棒!!!祝学习愉快~

0

0 学习 · 17877 问题

查看课程

相似问题