Dash-case keys

T.J. Crowder tj.crowder at farsightsoftware.com
Wed Jan 30 12:47:22 UTC 2019

On Tue, Jan 29, 2019 at 7:45 AM Sultan Tarimo
<thysultan at gmail.com> wrote:
> That is obj.font-size would rightly be invalid.

By which I think you mean, would still be `obj.font - size` with its
current meaning.

I don't think the confusion that causes is worth the benefit of not putting
the name in quotes in the object initializer. Particularly not with the
well-established convention of using camelCase in that situation when
interoperating with objects that have (or act like they have) dash-named
properties (like the CSSStyleDeclaration object on HTML elements).

-- T.J. Crowder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20190130/3f5cae51/attachment.html>

More information about the es-discuss mailing list