What does "coercion" mean in programming?
coercion is one of the most common terms in software development. This guide explains what it means, how it is used in practice, and why it matters, with real examples from the developer world.
Definition
Automatic or implicit conversion of a value from one type to another performed by the language at runtime. In JavaScript, adding a number to a string coerces the number into a string. Coercion can cause unexpected bugs.
Example
"console.log(1 + '2'); // '12' — JavaScript coerces 1 to a string"
Related terms
Ready to practice your English at work?
Lingua-e has interactive exercises built around real developer conversations: standups, code reviews, retrospectives, and more. Practice until it comes naturally.
Try Lingua-e for free