JavaScript Type Conversion
JavaScript variables can be converted to a new variable and another data type:
By the use of a JavaScript function
Automatically by JavaScript itself
Converting Strings to Numbers
The global method Number() converts a variable (or a value) into a number.
A numeric string (like "3.14") converts to a number (like 3.14).
An empty string (like "") converts to 0.
A non numeric string (like "John") converts to NaN (Not a Number).
Now that you know type conversion in javascript, let's learn objects in javascript
Share this page on :
© 2022 AnalyzeCode.com All rights reserved.