Looks like JavaScript, feels like Ruby, and it is a script language fitting in C programmers.
This project is maintained by Kray-G
while
statement is a pre-test loop.
The condition will be evaluated at the head of loop.
while (a == 0) {
// loop while a equals 0.
}
If you put true
or non-zero value at the condition, it means infinite loop.
break
statement is needed to exit an infinite loop.
while (true) {
// infinite loop.
if (codition) break;
}
var a = 5;
while (a--) {
System.println(a);
}
4
3
2
1
0
var i = 0;
while (true) {
if (i > 1000) break;
++i;
}
System.println(i);
1001