Monday, March 13, 2017

In JavaScript, a zero is equal to an empty array but not strictly so.

alert(0 === []);
alert(0 == []);

The first alert above returns false but the second alert returns true.

No comments:

Post a Comment