Everything else is truthy (including [] , {} , "0" ). The weird part: == does type coercion.
function getObj() return // ASI adds semicolon here → returns undefined ok: true ; understanding javascript the weird part parts
Here’s a structured guide to understanding the classic (and famously quirky) areas of JavaScript—often referred to as the “weird parts” made popular by Anthony Alicea’s course “JavaScript: Understanding the Weird Parts” . The weird part: You can use variables before they’re declared. Everything else is truthy (including [] , {} , "0" )