In Javascript, one of the reliable ways to convert a string to a number is the Number
constructor:
var x = Number(\'09\'); // 9, because it defa
In the first case, you are using the Number Constructor Called as a Function, as described in the Specification, that will simply perform a type conversion, returning you a Number
primitive.
In the second case, you are using the Number Constructor to make a Number
object:
var x = Number('09');
typeof x; // 'number'
var x = new Number('09');
typeof x; // 'object'
Number('1') === new Number('1'); // false
The difference may be subtle, but I think it's important to notice how wrapper objects act on primitive values.