if in statment js code example
Example 1: js if else
If - Else Statements
if (condition) {
// what to do if condition is met
} else {
// what to do if condition is not met
}
Example 2: if statements javascript
if (pros < 10) {
console.log("LESS THAN 10 PROS!");
}
else if (pros < 5) {
console.log("LESS THAN 5 PROS!");
}
else {
console.log("How many pros are there?");
}