It's because you're making a Number wrapper object instead of a primitive, and that's Chrome's chosen representation. (Console representations are not always the same. There's no standard.)
The actual number 10
is stored in an internal property called [[PrimitiveValue]]
, so it's not directly exposed.
To get its [[PrimitiveValue]]
, you can use the .valueOf()
method.
console.log(a.x.valueOf()); // 10
15.7.2.1 new Number ( [ value ] )
The
[[Prototype]]
internal property of the newly constructed object is set to the original Number prototype object, the one that is the initial value ofNumber.prototype
(15.7.3.1).The
[[Class]]
internal property of the newly constructed object is set to"Number"
.The
[[PrimitiveValue]]
internal property of the newly constructed object is set toToNumber(value)
if value was supplied, else to+0
.The
[[Extensible]]
internal property of the newly constructed object is set totrue
.