loading...

re: There's no "else if" in JS VIEW POST

FULL DISCUSSION
 
 

I would use const instead of var though (if you're gonna go es6).

And just for shits and giggles, the fn could be done as a one-liner:

const wow = arg => ({dog: "LOVELY", cat: "CUTE"}[arg] || "gimme an animal");
wow("cat");
 
code of conduct - report abuse