DEV Community

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

Collapse
 
6temes profile image
Daniel • Edited

Good point, buy maybe you should change your example so you don't use the return clause.

I feel like refactoring your example to:

function wow(arg){
  if (arg === "dog") return "LOVELY";
  if (arg === "cat") return "CUTE";

  return "gimme an animal";
}