@@toStringTag sounds like a function
# Domenic Denicola (12 years ago)
It's "toString tag", not "to StringTag".
# Nathan Wall (12 years ago)
Domenic Denicola wrote:
It's "toString tag", not "to StringTag".
Ah, you know, I hadn't made that connection. That's interesting.
I still think I would prefer something else... maybe even just @@tag. But that certainly makes more sense out of the naming.
Thanks!
# Brendan Eich (12 years ago)
@@tagForToString? Er, no.
It's actually not the whole return value of any toString call, of course. It is the %s in "[object %s]" returned by Object.prototype.toString.call(x) for an object x. This suggests
@@objectToStringTag
or something along those lines. Does that help?
The name
@@toStringTagsounds like a function, liketoStringandtoFixed, but it's just a string property. The fact that@@toPrimitiveis a function further makes the point.Has just
@@stringTagbeen considered?Nathan