`String.prototype.symbolAt()` (improved `String.prototype.charAt()`)

Mathias Bynens mathias at qiwi.be
Fri Oct 18 08:52:23 PDT 2013


On 18 Oct 2013, at 10:39, Domenic Denicola <domenic at domenicdenicola.com> wrote:

> Doesn't Unicode have some name for "visual representation of a code point"? Maybe it's "symbol"?

Not that I know of. I guess “Character” (http://www.unicode.org/glossary/#character) comes close, but we can’t really use that because `String.prototype.charAt` already exists. FWIW, I always use the term “symbol” to refer to a string that represents a single code point.

IMHO it’s not _really_ confusing to name this new method `symbolAt` because it’s defined on `String.prototype`, which indicates that it acts on strings and has nothing to do with ES6 Symbols. That said, I welcome better suggestions :)



More information about the es-discuss mailing list