Type Coercion
Type Coercion — Type coercion is JavaScript's automatic or implicit conversion of values from one data type to another (e.g., string to number). JavaScript has both implicit coercion (when operators trigger automatic type conversion) and explicit coercion (when you intentionally convert types using functions like `Number()` or `String()`). Implicit coercion can be a source of bugs. Always use `===` (strict equality) instead of `==` (loose equality with coercion) to avoid surprises. This term relates to the Operators category of the reference. You will meet type coercion in practice when working with APIs such as + (Addition), - (Subtraction), * (Multiplication), === (Strict Equality). Related terms: Closure, Hoisting, Event Loop, Prototype Chain, Temporal Dead Zone (TDZ), IIFE (Immediately Invoked Function Expression). Understanding type coercion makes the rest of the JavaScript documentation noticeably easier to follow, because the concept recurs across methods, guides, and error messages.