If else condition in javascript

if else condition kyai hai javascript me pl share in example

var a = 20;
var b =15;

if ( condition ) {
// block of code to be executed if the condition is true
}
else {
// block of code to be executed if the condition is false
}

if(a>b){
console.log(“true”);
}
else{
console.log(“false”);
}

1 Like