Number() converts to a Number, String() converts to a String, Boolean() converts to a Boolean.
JavaScript Data Types
In JavaScript there are 5 different data types that can contain values:
stringnumberbooleanobjectfunction
There are 6 types of objects:
ObjectDateArrayStringNumberBoolean
And 2 data types that cannot contain values:
nullundefined
Practice Excercise Practice now