In javascript you can call a function as a function or as a constructor. For example you can do :
myObject = new Number(13);
myPrimitiveValue = Number(13);
or simply
myPrimitiveValue = 13;
I understand the difference between the results. Can you explain me under which reasonable circumstances creating a number, a boolean or a string as an object is desirable? For example, ability to set new properties (this is something you can do on objects but can’t really do on primitive values) is almost always a bad idea for objects containing number/boolean/string. Why would I want a numeric/boolean/string object?
You rarely have to create objects for the basic data types.
From the Microsoft documentation of the Number object: