Make your website interactive with JavaScript
Difficulty: Beginner ● Progress: 0 / 0 modules completed
Conditions
In programming, in order for a piece of software to be able to decide to execute one chunk of code rather than another, we use conditions!
To create a condition, we need an action to perform (a block of code), and a conditional expression that will decide whether or not the code should be executed.
In JavaScript, a condition is written like this:
if(/* si expression conditionnelle */) {
/* alors action */
}
You need a free account to read this module