Skip to main content Skip to docs navigation

Type Conversion

Type conversion (or typecasting) means transfer of data from one data type to another. Implicit conversion happens when the compiler (for compiled languages) or runtime (for script languages like JavaScript ) automatically converts data types. The source code can also explicitly require a conversion to take place.

On this page

Type conversion

For example, given the expression "foo" + 1 , the Number 1 is implicitly converted into a String and the expression returns "foo1" . Given the instruction Number("0x11") , the string "0x11" is explicitly converted to the number 17 .

See also

Updated on April 20, 2024 by Datarist.