primitive wrapper constructor vs casting function

Be ware of the different of the primitive wrapper constructor and the casting function.

 
<!DOCTYPE html>
<html>
<head>
    <title>Example</title>
    <script type="text/javascript">
        var value = "25"; 
        var number = Number(value); //casting function 
        document.writeln(typeof number); //"number" 
        
        
        var obj = new Number(value); //constructor 
        document.writeln(typeof obj); //"object" 
       
    </script>
</head>
<body>
</body>
</html>
  
Click to view the demo
Home 
  JavaScript Book 
    Language Basics  

Primitive Wrapper Class:
  1. Primitive wrapper class
  2. Object constructor acts as a factory method for primitive data types
  3. primitive wrapper constructor vs casting function