Why ES6 introduced classes yet `Symbol` not to be used with `new`?

Domenic Denicola d at domenic.me
Sun Aug 14 23:15:11 UTC 2016


Symbol is not a class.

From: es-discuss [mailto:es-discuss-bounces at mozilla.org] On Behalf Of /#!/JoePea
Sent: Sunday, August 14, 2016 18:31
To: es-discuss <es-discuss at mozilla.org>
Subject: Why ES6 introduced classes yet `Symbol` not to be used with `new`?

It seems like `new Symbol()` would be inline with the introduction of classes. Why was it chosen not to be constructible? Seems like it would make sense to throw an error on `Symbol()` but not `new Symbol()`. Was it to save three characters of typing?

/#!/JoePea
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160814/5162a3b1/attachment.html>


More information about the es-discuss mailing list