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