JavaScript If…Else Statements

Conditional statements are used to perform different actions based on different conditions. Conditional Statements Very often when you write code, you want to perform different actions for different decisions. You can use conditional statements in your code to do this. In JavaScript we have the following conditional statements: Use if to specify a block of code to […]

JavaScript Statements

Example var x, y, z;    // Statement 1 x = 5;          // Statement 2 y = 6;          // Statement 3 z = x + y;      // Statement 4 Try it Yourself » JavaScript Programs A computer program is a list of “instructions” to be “executed” by a computer. In a programming language, these programming instructions are called statements. A JavaScript program is a list of programming statements. In […]