Tech
Type Coercion & Type Casting
Type Coercion in javascript is a process where a type is converted to another type explictly or implicitly. When it happens explictly, it is known as type casting and in case of implicit conversion, it is known as type coercion.
There are 3 types of conversion:
String Conversion
Number Conversion
Boolean Conversion
String Conversion
Explicit Conversion
String(123) => “123”
String(true) => “true”
Implicit Conversion
It happens automatically with + operator, ...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to