About 631,000 results
Open links in new tab
  1. JavaScript if, else, and else if - W3Schools

    The else if Statement. Use the else if statement to specify a new condition if the first condition is false. Syntax

  2. if...else - JavaScript | MDN - MDN Web Docs

    Mar 13, 2025 · The if...else statement executes a statement if a specified condition is truthy. If the condition is falsy, another statement in the optional else clause will be executed.

  3. if statement - "elseif" syntax in JavaScript - Stack Overflow

    Use else to specify a block of code to be executed, if the same condition is false. Use else if to specify a new condition to test, if the first condition is false

  4. JavaScript if...else Statement (with Examples) - Programiz

    We use the else keyword to execute code when the condition specified in the preceding if statement evaluates to false. The syntax of the else statement is: // block of code // execute …

  5. JavaScript if-else - GeeksforGeeks

    May 31, 2024 · JavaScript if-else statement executes a block of code based on a condition. If the condition evaluates to true, the code inside the "if" block executes; otherwise, the code inside …

  6. Conditional branching: if, - The Modern JavaScript Tutorial

    Dec 7, 2022 · To do that, we can use the if statement and the conditional operator ?, that’s also called a “question mark” operator. The “if” statement. The if(...) statement evaluates a …

  7. JavaScript if else if - JavaScript Tutorial

    To check multiple conditions and execute the corresponding block if a condition is true, you use the if...else...if statement like this: if (condition1) { // ...} else if (condition2) { // ...} else if …

  8. JavaScript If...Else Conditional Statements - Tutorial Republic

    The ternary operator provides a shorthand way of writing the if...else statements. The ternary operator is represented by the question mark (?) symbol and it takes three operands: a …

  9. JavaScript If-Else and If-Then – JS Conditional Statements

    Aug 9, 2021 · In this article, I will explain what an if...else statement is and provide code examples. We will also look at the conditional (ternary) operator which you can use as a …

  10. JavaScript if/else Statement - W3Schools

    The if/else statement executes a block of code if a specified condition is true. If the condition is false, another block of code can be executed. The if/else statement is a part of JavaScript's …

  11. Some results have been removed
Refresh