Learn JavaScript Programming

A scripting language that enables you to create dynamically updating content, control multimedia, animate images, and pretty much everything else.

JS Introduction
JS Control flow
JS Functions
JS Objects
JS Types
Exceptions and Modules
JS ES6
JavaScript Asynchronous
Miscellaneous

JS type conversion

JavaScript Type Conversion

JavaScript variables can be converted to a new variable and another data type:

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 if else statement in javascript


Share this page on :