SOURCE

for (var i = 1; i <= 10; i++) {
    if (i % 2 == 0) { console.log(i); }
}

var count;
for (count = 0; count <= 10; count = count + 1) { console.log("Count的值是" + count); }

var count = 0;
while (count <= 10) {
    console.log("Count的值是" + count);
    count = count + 1;
}

var count = 0;
do {
    console.log("Count的值是" + count);
    count = count + 1;
}
while (count <= 10)



var i;
var j;
var k;
for(var i = 1; i <= 9; i++) {
    for (j = 1; j < 9; j++) {
        for (k = 1; k < 9; k++) {
            var real_number = i * 100 + j * 10 + k;
            if (i * i * i + j * j * j + k * k * k == real_number){
                console.log("发现水仙花数:" + real_number);
            }
        }
    }
}
console 命令行工具 X clear

                    
>
console