If-Else Statement in JS in JavaScript

🟢 Beginner

📖 Definition

An if-else statement executes alternative blocks in JavaScript.

âš¡ Code Example

let num = 10;
if (num % 2 === 0) { console.log("Even"); }
else { console.log("Odd"); }

🧭 Navigation

← 01. If Statement in JS | Module Index | 03. Else-If Ladder in JS →