An alternative to IF ELSE statements in Javascript



An alternative to IF ELSE statements in Javascript

An alternative to IF ELSE statements in Javascript

It’s not uncommon for IF ELSE statements to get out of control, take this for example, you want to get the numerical value of a month.

If January then return 1 else if February return 2, etc. etc.

But instead of writing all this code you could be taking advantage of a javascript object.

#javascript #learntocode #shorts

Comments are closed.