mardi 16 janvier 2018

What should be the correct way of writing if-else statement in JS [on hold]

This might not be the best place for asking this, however I feel it is still not completely out of order.

I remember reading a while ago that while coding in JavaScript

if() {

} else {

}

should be avoided and following should be preferred

if() {

}
else {

}

I remember reading that the former had some security implications or may be some kind of best practice for some reasons.

Can someone explain if there is something like this ?

Aucun commentaire:

Enregistrer un commentaire