jeudi 25 mai 2017

What is the best practice of using if condition in JavaScript?

var foo = "bar";
if (foo) {
  console.log(foo);
}

var foo = "bar";
if (!!foo) {
  console.log(foo);
}

Which one should I use?

Performance wise both ways look same.

http://ift.tt/2qgh7DM

Aucun commentaire:

Enregistrer un commentaire