String.prototype.trimRight/trimLeft

Dmitry Soshnikov dmitry.soshnikov at gmail.com
Mon Jul 27 23:55:31 UTC 2015


OK, it was added to the agenda for the next meeting (will be presented
by Sebastian Markbage), so can be discussed in detail. I agree that
"start", and "end" are now probably better fit (because of i18n, and a
strong correlation with "startsWith" and "endsWith"). We can probably
ignore the de-facto shipped in browsers, they will just implement in
addition `trimStart` and `trimEnd`, and eventually deprecate the "right"
and "left".

Dmitry

On Tue, Jul 21, 2015 at 12:02 AM, Claude Pache <claude.pache at gmail.com>
wrote:

>
> > Le 21 juil. 2015 à 08:28, Jordan Harband <ljharb at gmail.com> a écrit :
> >
> > On the contrary -"left" always begins at index 0 - "start" is sometimes
> index 0, sometimes index (length - 1).
>
> Counter-example: ES6 methods `String#startsWith` and `String#endsWith` are
> named correctly.
>
> > I think "left" and "right" are the right names; "start" and "end" would
> require unicode bidirectional stuff.
>
> No, because characters in Unicode strings are ordered logically, not
> visually.
>
> —Claude
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150727/5329ffab/attachment.html>


More information about the es-discuss mailing list