Truthy and Falsy: When All is Not Equal in JavaScript

Truthy and Falsy: When All is Not Equal in JavaScript

JavaScript variables are loosely/dynamically typed and the language doesn’t care how a value is declared or changed.

2017.08.22: This article has been updated to reflect the current state of the JavaScript ecosystem.

[…]

Internally, JavaScript sets a value to one of six primitive data types:

[…]