循环输出 我今年1-100岁了

for (var i = 1;i <= 100;i++){
    console.log("我今年"+ i +"岁了")

}

2023-06-26T12:51:33.png

循环内判断

for (var i = 1; i <= 30;i += 4){
    if(i % 3 == 0){
        console.log(i);
    }
}

2023-06-26T13:29:44.png

循环内循环

for (var i = 1; i <= 4; i++) {
    for (var j = 5; j <= 8 ; j++){

        
    console.log(i,j);
    }
}

2023-06-26T13:27:25.png