I noticed I can use a && b();
as a shorthand for if(a) {b()}
or if(a) b();
. The MOST usual case for this indecision is for objects having 4-5 elements.
Question: is there a performance gain/loss for using the shorthand when compared with an iteration of if(){}
or regular object traversing for (var i in b) { b[i]() }
?
Aucun commentaire:
Enregistrer un commentaire