Type Coercion
Noun · Development
Definitions
The automatic, implicit conversion of a value from one type to another performed by the language runtime when operand types don't match — most infamously in JavaScript, where `'5' + 3` yields `'53'` (string concatenation) but `'5' - 3` yields `2` (numeric subtraction). Coercion follows language-specific rules that can produce surprising results.
In plain English: When a programming language automatically converts data from one type to another behind the scenes, sometimes with surprising results.
Example: "JavaScript coerced `[] + {}` into the string '[object Object]' — this is why we use TypeScript."