jeudi 4 avril 2019

Difference between nested if (condition) and logical operator

What is difference between nested if (condition) and logical operator in terms of performance and logic.

if(a && b && c){
 //do something 
 }

if(a){
   if(b){
         if(c){
       //do something
     }
   }
 }

Are the above codes same logic wise? My main concern is performance of the code, performance wise which is the best to use ?

Aucun commentaire:

Enregistrer un commentaire