Comments (7)
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.
That's a good question. The options are either:
- they are
!==
- they are
===
and their names aretrimStart
/trimEnd
- they are
===
and their names aretrimLeft
/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.
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.
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.
Agree.
from proposal-string-left-right-trim.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proposal-string-left-right-trim.