My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

In how many ways can we implement the following if and else code? Forget optimisation.

Default profile photo
Anonymous
·Jul 4, 2018

What are all the possibilities?

Lang: JavaScript

if (x > 5) {
 /* do the right thing */
} else if (x > 50) {
 /* do the right thing */
} else {
 /* do the right thing */
}