Sign in
Log inSign up

"if inside if" vs. "if after if"!

Mojtabaa VDev's photo
Mojtabaa VDev
·Jul 13, 2018

What are the differences between these two:

if( ! condition ){
     if( ! another_condition ){
           //do something
     }
}
//return

and

if(condition){
     //return
}
if(another_condition){
    //return
}
//do something
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