Nested if..else statements are the ones in which one conditional statement (if statement or if..else statement) is nested inside another conditional statement (if statement or if..else statement).
Example:
var x = 10; if (x === 0) { console.log("Neither positive nor negative!"); } else if (x > 0) { if (x < 10) { console.log("Single-digit positive number!"); } else { console.log("More than one-digit positive number!"); } } else { console.log("Negative number!"); }
Output:
"More than one-digit positive number!"
Here, an if..else block is nested inside another else..if block in a if..else..if chain. This is an example of nested if..else statements.