<script>
var num = new Number(43);
console.log(num);
</script>
According to the tutorial here: http://www.w3schools.com/jsref/jsref_obj_number.asp
Syntax
var num = new Number(value);
Note: If the value parameter cannot be converted into a number, it returns NaN (Not-a-Number).
Question:
In firebug->console, it shows: Number {}
, not what I expect Number {43}
, no matter what number i put in new Number(value)
; it always shows:Number {}
so what is the purpose to use new Number(value)
? how does it work? BTW, I googled on line, but did not find a good explanation.