The progress in your scripts depends on the evaluation of conditions to decide the direction of your scripts flow. The evaluations may present one or more directions the script should take to continue the progress.
​
The basic conditional test in JavaScript is done with the if keyword. It test a condition for a boolean (true/false) value. So if a condition is met(true) the script does something.
When the script has to perform operations that goes over multiple lines the code will look like this. The code that is going to be run is then between curly brackets {}.
Lets look at some code that is closer to real-life code.
Here we will check if a number is positive (more than 0).
Using if is simple and understandable, but alone in a setting like this it's not doing much. Next we will look at expanding the if statement.