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

Andrea Giammarchi andrea.giammarchi at gmail.com
Fri Oct 18 13:38:47 PDT 2013


If I understand Allen answer looks like `Array.from(“💩&💩”).length` would
do, being 3, and making the operation straight forward?

Cheers


On Fri, Oct 18, 2013 at 1:33 PM, Mathias Bynens <mathias at qiwi.be> wrote:

> On 18 Oct 2013, at 15:12, Andrea Giammarchi <andrea.giammarchi at gmail.com>
> wrote:
>
> > so my counter-question would be: is there any way to do that in core so
> that we can “💩💩💩”.split() it so that we can have an ArrayLike that with
> [1] gives back the single “💩” and not the whole thing ?
>
> This brings us back to the earlier discussion of whether something like
> `String.prototype.codePoints` should be added:
> http://esdiscuss.org/topic/how-to-count-the-number-of-symbols-in-a-stringI think it would be useful
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20131018/2d64ec1e/attachment.html>


More information about the es-discuss mailing list