JavaScript

Type Coercion

Definition

JavaScript's automatic conversion of values from one type to another during operations. Implicit coercion happens with operators like `==`, `+`, and in boolean contexts. Explicit coercion uses functions like `Number()`, `String()`, `Boolean()`.

Code Example

Javascript
Tip: Modify the code above and click “Run” to see the results

Learn More

Related Terms