Javascript – if else and switch

Javascript – if else and switch

if, else, else if and switch are condition statements and are used when you want to execute a block of statements according to a condition. if (condition) { statement(s) } if (condition) { statement(s) } else { statement(s) } if (condition) { statement(s) } else if (condition) { statement(s) } else { statement(s) } Instead of having multiple if statements you can use switch switch(expression) { case a: statement(s) break; case b: statement(s) break; case b: statement(s) break; default: statement(s) Javascript – if else and switch

Javascript – if else and switch Read More