Use the js for loop method to write a box with 6 balls. Take one of them at a time. Repeat to take the balls from the box until the balls are taken out. Each time you get one, it will output in the console "This is the nth removed Balls"

Use the js method to calculate that there are 6 balls in a box, take one of them at a time, and repeat to take the balls from the box until the balls are taken out. Every time one is taken, the console outputs "This is the nth ball removed"

```<!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>
    <script>
        var num=1;
        for (num=1;num<=6;num++){
    
    
           console.log('这是去除的第'+num+'个球</br>')
       }
        
    </script>
</body>
</html>

Insert picture description here

Guess you like

Origin blog.csdn.net/GengFuGuo/article/details/108697729