Why do the built-in constructors in javascript return a value and not an object?They are called with the new operator and They still do not return an object.How can I create a constructor which doesn't return an object like :
new Number() //returns 0 instead of [Object object]
new String() //returns ""
new Date() //returns today's date
function SomeConstructor() {
return "Value"
}
new SomeConstructor() // [Object object]
SomeConstructor() // returns "Value"
How can I create such a constructor?