Use theelse ifstatement to specify a new condition if the first condition is false. Syntax if(condition1) { //block of code to be executed if condition1 is true }elseif(condition2) { //block of code to be execu
To explore JavaScript beyond what we cover in this tutorial, consider completing theW3School’s free JavaScript training. Basic JavaScript Syntax While human languages rely on grammar to make sense, programming languages rely on syntax. These are the set of rules that define how you need to write...
The variable carName will have the value undefined after the execution of this statement: Example var carName; Re-Declaring JavaScript Variables If you re-declare a JavaScript variable, it will not lose its value. The variable carName will still have the value "Volvo" after the execution of ...