jeudi 31 août 2017

When obj = null, why doesn't (obj && (obj[1] || obj[2])) throw error?

Since operations inside parenthesis are executed first and obj is null, isn't it supposed to throw error when trying to read property of null? I am confused about order of operations, OR is evaluated before AND right?

Aucun commentaire:

Enregistrer un commentaire