mercredi 24 juin 2015

Why do some people write their multi conditionals different in javascript?

Ok so a quick example of how I would write a conditional:

if( a.val().length < 9 && b.val().length == 8 && c.val.length <=5 ){
// Do Something
}

Now someone people do this and i'm very curious as to why.

 if( (a.val().length < 9) && (b.val().length == 8) && (c.val.length <=5) ){
    // Do Something
    }

They wrap a parenthesis during each condition. I do not understand why people do this at all. Does it have a purpose or does it just have the same results as the way I write them?

Aucun commentaire:

Enregistrer un commentaire