use if in javascript code example
Example 1: javascript if
if (32 == 32) {
console.log('32 is equil to 32!');
}
Example 2: javascript if else
/* Shorten if-else by ternary operator*/
const go = "yes"
let race = null
race = go === "yes" ? 'Green Light' : 'Red Light';