Number() constructor creates a
Number object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful.
Number()can be called with or without
new, but with different effects. See Return value.
- : The numeric value of the object being created.
Number is called as a constructor (with
new), it creates a
Number object, which is not a primitive.
Warning: You should rarely find yourself using
Numberas a constructor.