JavaScript terminology: non-function-valued property

Jeff Walden jwalden+es at MIT.EDU
Fri Jul 22 16:07:13 PDT 2011


On 07/22/2011 03:16 PM, Mike Shaver wrote:
> Which primitives have own properties?  I thought even "str".length conceptually came from the prototype.

Spec-wise, it comes from the boxed String object created when you attempt to look up a property on a primitive string.  It's the same for "str"[0] and so on.  (Serious implementations probably wouldn't actually box up the primitive in either case, of course, and would have fast-path logic.)

Jeff


More information about the es-discuss mailing list