do while循环

242 阅读1分钟
<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>
    <script>
        // do while不管条件如何,先运行一遍代码
        var n=1;
        do{
            console.log("hello world");
            n++;
        }while(n<10)
    </script>
</body>
</html>