Types, scope, the event loop and the language's sharp edges.
JavaScript rewards a mental model built on three ideas: types & coercion, scope & closures, and the event loop.
Every value is one of a handful of primitives or an object. The famous "wat" moments come from implicit coercion.
[] + [] // "" (both become empty strings)
[] + {} // "[object Object]"
0.1 + 0.2 // 0.30000000000000004 (IEEE-754 floats)=== over == to skip coercion entirely, and reach for Number.EPSILON when comparing floats.A closure captures variables by reference, not by value. This is the engine behind data privacy and stateful callbacks.
Synchronous code runs to completion, then all microtasks drain, then one macrotask is taken. Internalize that order and async stops being mysterious.