vendredi 9 novembre 2018

if test on [undefined]

[undefined] === true returns false.

if ([undefined]) { 
  console.log('is true') 
}

prints is true to the console.

How does this make sense?

Aucun commentaire:

Enregistrer un commentaire