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

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // while
        var n = 10
        while (n > 0) {
            n = n - 2
        }
        console.log(n)

        // do while
        var n = 10
        do {
            n = n - 2
        } while (n > 0)
        console.log(n)
    </script>
</head>

<body>
    hi while
</body>

</html>