if statemnt shorthand js without else

JavaScript
//else if statement shorthand
y = (x === 2) ? 1 : (x === 3) ? 2 : (x === 4) ? 7 : 1000;
Source

Also in JavaScript: