Those are just the native objects; you use this
just like in a normal prototype function.
Note that you are indeed working with objects: instances built with the "String" or "Number" or some other native constructor. Things like "hello world"
and 12.54
are not objects, they're primitives. They don't have prototypes.
When you use a primitive object as if it were an object, the runtime automatically promotes it to an object instance. That happens when you use a primitive value with the .
or []
operators.
From such objects (instances of String, Number, or Boolean), the primitive value can be fetched with this.valueOf()
.