Sign in
Log inSign up

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 */
}
Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct