js 数组遍历arr_for.html

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>arr_for</title>
</head>

<body>
    <script>
        var arr = [1,2,3];
        for(let a of arr){
            console.log(a)
        }
        // 1
        // 2
        // 3
    </script>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/weixin_42193179/article/details/88124502