DEV Community

Discussion on: There's no "else if" in JS

Collapse
 
lgkonline profile image
Lars / LGK

You also realize it when you want to use the shorthand.
On the shorthand syntax there is no "else if". You have to write this instead:


(arg === "dog" ? "LOVELY" : (arg === "cat" ? "CUTE" : "gimme an animal"))