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

"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