Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to use if else statement in javascript

var condition = true; // An example condition for true/false conditions

if (condition == true) {
	console.log('condition is true');  
} else {
	console.log('condition is not true');  
} // Console will output 'condition is true'
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #statement #javascript
ADD COMMENT
Topic
Name
4+5 =