Professional Documents
Culture Documents
Make sure that the start & end value is the same.
+= Addition
You can perform the
operation and assign the -= Subtraction
value at the same time using
/= Division
a compound operator.
*= Multiplication
Modulo
%= (Remainder After
Division)
String Operations
if(x>25) {
console.log(`${x} is greater than 25`)
} else {
console.log(`${x} is not greater than 25`)
}
The else part isn’t need, but it will give our user feedback either way.
You can also write else if (CONDITION) with some other condition, as many times as you’d like.
The conditions are checked until one of them is considered true and then it stops.
Exercise #3