GithubHelp home page GithubHelp logo

Comments (7)

evilpie avatar evilpie commented on June 24, 2024 1

I think we can close this for now. If this for some reason is causing concern at the meeting we can reopen the issue.

from proposal-string-left-right-trim.

ljharb avatar ljharb commented on June 24, 2024

That's a good question. The options are either:

  • they are !==
  • they are === and their names are trimStart/trimEnd
  • they are === and their names are trimLeft/trimRight

I think that the easiest as well as the one that ends up with the preferred names is the first option - where they are different functions but both call the same internal abstract operation.

from proposal-string-left-right-trim.

zloirock avatar zloirock commented on June 24, 2024

The first way the easiest, but currently in the spec if functions do the same - it's the same functions. Simple example - Set#{keys, values, @@iterator}.

from proposal-string-left-right-trim.

ljharb avatar ljharb commented on June 24, 2024

That's a good point. Based on that pattern, it'd be one of the second two - probably the third option for easier legacy compat.

from proposal-string-left-right-trim.

zloirock avatar zloirock commented on June 24, 2024

Agree.

@sebmarkbage ?

from proposal-string-left-right-trim.

claudepache avatar claudepache commented on June 24, 2024

FWIW, Date.prototype.toGMTString === Date.prototype.toUTCString is true (with name "toUTCString") in Firefox and ES2015, but false in Chrome, Safari (with names "toGMTString" and "toUTCString") and IE (without name).

If we seek spec consistency with that precedent, the option "=== w/ names trimStart/trimEnd" should be picked. Also, I don’t think there is much compat issue around the name of these functions, since functions in IE11 have no name.

Anyway, personally I don’t care, as long as the "official" function (trimStart) gets the "correct" name ("trimStart").

from proposal-string-left-right-trim.

ljharb avatar ljharb commented on June 24, 2024

The current spec makes trimStart and trimEnd be the canonical functions with the appropriate name, which are === to trimLeft/trimRight.

from proposal-string-left-right-trim.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.