5 Tips For Writing More Maintainable JavaScript Code
Functionite
643

By return early, do you mean multiple early returns? Like this:

function num(a) {

if(a===”1”){

return “one”;
}
if(a===”2”){

return “two”
}
if(a===3){

return “three”
}
return “else”;
}

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.