Région de recherche :

Date :

https://developer.mozilla.org › fr › docs › Web › JavaScript › Reference › Statements › if...else

if…else - JavaScript | MDN - MDN Web Docs

L'instruction if…else exécute une instruction si une condition donnée est équivalente à vrai. Si la condition est équivalente à faux , ce sera l'instruction de la clause optionnelle else qui sera exécutée.

https://www.w3schools.com › js › js_if_else.asp

JavaScript if, else, and else if - W3Schools

Use if to specify a block of code to be executed, if a specified condition is true. 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.

https://developer.mozilla.org › fr › docs › Web › JavaScript › Reference › Operators › Conditional...

L'opérateur conditionnel - JavaScript | MDN - MDN Web Docs

L'opérateur (ternaire) conditionnel est le seul opérateur JavaScript qui comporte trois opérandes. Cet opérateur est fréquemment utilisé comme raccourci pour la déclaration de Instructions/if...else .

https://www.pierre-giraud.com › javascript-apprendre-coder-cours › condition-if-else

Les conditions if, if…else et if…else if…else en JavaScript

La condition if…else en JavaScript. La condition if est une structure conditionnelle limitée par définition puisqu’elle ne nous permet d’exécuter un bloc de code que dans le cas où le résultat d’un test est évalué à true mais elle ne nous offre aucun support dans le cas contraire.

Les conditions if, if…else et if…else if…else en JavaScript

https://fr.javascript.info › ifelse

Branche conditionnelle : if, - JavaScript

L’instruction if(...) évalue une condition entre parenthèses et, si le résultat est true, exécute un bloc de code. Par exemple : let year = prompt('In which year was ECMAScript-2015 specification published?', ''); if (year == 2015) alert( 'You are right!'

https://developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Statements › if...else

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

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.

https://www.w3schools.com › jsref › jsref_if.asp

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 "Conditional" Statements, which are used to perform different actions based on different conditions.

https://javascript.info › ifelse

Conditional branching: if, - The Modern JavaScript Tutorial

The “if” statement. The if(...) statement evaluates a condition in parentheses and, if the result is true, executes a block of code. For example: let year = prompt('In which year was ECMAScript-2015 specification published?', ''); if (year == 2015) alert( 'You are right!' );

https://fr.w3docs.com › apprendre-javascript › conditional-operators.html

Javascript Conditional Operators: if, ‘?’ | W3Docs JavaScript Tutorial

In this chapter you will learn how to perform different actions based on different conditions, using the if, ‘?’ statements, the conditional operator and more.

Javascript Conditional Operators: if, ‘?’ | W3Docs JavaScript Tutorial

https://www.freecodecamp.org › news › if-statements-javascript

How to Use If Statements in JavaScript – a Beginner's Guide

An if statement is a conditional statement that allows you to execute a block of code only if a specified condition is true. In other words, it provides a way to make decisions in your code.

How to Use If Statements in JavaScript – a Beginner's Guide