Home >Web Front-end >JS Tutorial >Js in bits - ype Conversions)
Learning js should be fun. It is fun if it's easy.
I tried my best in writing this, to understand it the easy way.
Type Conversions
Most of the time, operators & functions automatically convert the vals given to them to the right type.
String Conversion
Number Conversion
Conversion happens in Mathematical functions & expressions automatically.
A valid string(number) will be converted to valid number
Invalid string(number) results in NaN
Math conversion rules:
Boolean Conversion
Few valid boolean conversions that results in false
Examples of boolean conversion:
Leave y'r thoughts....
The above is the detailed content of Js in bits - ype Conversions). For more information, please follow other related articles on the PHP Chinese website!