Skip to content

2.6 Type Conversions

Bunlong VAN edited this page Feb 14, 2018 · 4 revisions

Most of the time, operators and functions automatically convert a value to the right type. That’s called “type conversion”.

For example, alert automatically converts any value to a string to show it. Mathematical operations convert values to numbers.

There are also cases when we need to explicitly convert a value to put things right.

Clone this wiki locally