Looks like JavaScript, feels like Ruby, and it is a script language fitting in C programmers.
This project is maintained by Kray-G
if-else
statement is a conditional jump.
else
clause is not always necessary.
if (a == 0) {
// then clause
}
Here is the example with else
clause.
if (a == 0) {
// then clause
} else {
// else clause
}
You can combine multiple if-else
statements like C.
if (a == 0) {
// then clause
} else if (b == 0) {
// next if-else statement
} else {
// else clause
}
var age = 10;
if (age < 20) {
System.println("young");
} else {
System.println("adult");
}
young
var age = 10;
if (age < 20) {
System.println("young");
}
young
var age = 20;
if (age < 20) {
System.println("young");
} else if (age > 20) {
System.println("adult");
} else {
System.println("just 20");
}
just 20