javascript if else if shorthand code example
Example 1: shorthand if statment in js
isLoggedIn ? "Logout" : "Login";
Example 2: if statemnt shorthand js without else
//else if statement shorthand
y = (x === 2) ? 1 : (x === 3) ? 2 : (x === 4) ? 7 : 1000;