
ES7 brings two new features - kiyanwang
https://medium.freecodecamp.org/why-could-es7-be-called-es2-4c5f094ccef7
======
nkg
I will welcome ".include(a)" into my code in place of the awkward
".indexOf(a)!== -1". Better late than never, I guess.

~~~
tomatsu
Too bad it was renamed. "Contains" was a much better name.

"Contains" is used everywhere else - the DOM API included
(Element.classList.contains).

~~~
runarberg
If I remember correctly, the array methods `.includes`, `.every`, and `.some`
were renamed because of collision with prototype.js's `.contains`, `.all`, and
`.any` respectively.

~~~
eximius
That is the stupidest thing I've ever heard. Why would that matter? That would
encourage me the naming choice was in the right direction!

~~~
thaiphanvevo
Lots of websites still use Prototype.js. Magento still has it as a dependency.
Don't want to break the web!

~~~
eximius
Would it break the web though? Wouldn't they just override the native
implementation with a JS one?

~~~
curtisblaine
Then the two implementations would probably be incompatible (different
signatures, different implementation / return values) and would cause
unexpected errors down the chain. So, essentially, breaking the web and making
it difficult to fix it.

------
lyschoening
We're at ECMAScript 2017 now. The author is one version behind.

~~~
masklinn
ES2017 is also a much more consequential revision:

* async functions

* shared buffers (between workers) and atomic operations for these buffers

* additional native object methods (Object.values, Object.entries, Object.getOwnPropertyDescriptor, string padding)

* trailing commas in function argument lists (definition & callsite)

* unicode case folding in /ui

~~~
amptorn
When's the `|>` pipe operator expected?

~~~
masklinn
That… doesn't even make sense as a question.

All one can say about it is that it was promoted to Stage 1 18 days ago, that
the spec is not currently written, and that it has two dozen issues opened
against it.

------
Slackwise
Still waiting on TCO.

~~~
CapacitorSet
That is already in ES6, no?

~~~
masklinn
Yes, but only Webkit/Safari implements it.

~~~
curtisblaine
== 75% of the Web.

------
Myrmornis
Is there any chance of comprehensions appearing in JS soon? That’s the main
thing I miss from the coffeescript years.

------
kbody
Is this a joke? It's presented a bit as a joke, but not sure.

~~~
jakub_g
The ES committee has decided to do yearly releases instead of feature-based
releases. No more waiting for things to get finished; if it's not ready, it
gets postponed to the next version of the standard.

Hence the official terminology is ES2015, ES2016 etc. "ES6" stayed there in
dev parlance because it was the initial name while the work was in progress.

~~~
masklinn
> The ES committee has decided to do yearly releases instead of feature-based
> releases. No more waiting for things to get finished

Indeed, and so that people understand the concept of "finished", "TC39"
(ECMAScript) proposals have 5 stages:

* Stage 0 (strawman), having an idea

* Stage 1 (proposal), making a formal proposal explaining the problem, the general shape of a solution, an example high-level API, and identifying cross-cutting concerns and issues

* Stage 2 (draft) is the writing of the formal specification

* Stage 3 (candidate) is the completion of the formal specification and its sign-off by reviewers and the ECMAScript editor, no further work is possible without implementation feedback

* Stage 4 (finished) is a test262 acceptance test suite and two independent compatible implementations, the feature will be included in the next ECMAScript standard revision

------
janci
Two more points for the javascript fatigue.

------
Hurtak
> ['my','mom','hates','me'].indexOf('mom') // 1

> life.includes('girlfriend') // false

That are some depressing code examples, is the author ok?

~~~
coldtea
Or, you know, they are joking...

~~~
moomin
Serious point: you should pay attention to the content of jokes. People often
use them to say things they can't say. This holds true of depressed people,
racist people and, I imagine, Harvey Weinstein.

~~~
coldtea
They do -- but self deprecating humor is also a thing in geek circles, without
necessarily pointing to some deep seated anxiety. And I'm not sure the author
would appreciate people discussing his personal life because of that.

Being able to still joke about things is a good sign anyway -- even if you
feel those things.

------
amgin3
cool, can't wait to use these in 10 years when browser compatabilty catches
up.

~~~
masklinn
All modern browsers (no that does not include IE11) have full ES2016 support
in their stable version.

In fact, aside from Edge which lags a bit behind (and FF 52 ESR) all of them
seem to have full ES2017 support already in their latest stable.

~~~
amgin3
up to 12% of internet users still use IE11, and even more if you count lower
versions. It will take them about a decade to upgrade to a "modern browser".
There are still large companies who want browser compatibility down to IE 8.

~~~
masklinn
That's not a matter of "browser compatibility" which is what GP complained
about. The browsers are compatible, if you decide not to use them, you can
hardly fault the browsers.

------
gushie
It would be more useful if in the version they could use the year that most
people will likely have a browser that supports these, rather than the year
they were introduced

~~~
michaelmior
That seems like it would make it very challenging to assign a version upon
release. And there's also the possibility of overlapping versions.

~~~
vitus
Right. While this is an open process, and browser vendors are well aware of
these when the spec is announced, the only way to enforce this in a meaningful
way would be for all the vendors to coordinate... which I don't exactly see
happening. There's no reason for vendors to delay a feature just because their
competitors aren't ready yet.

As for availability of these two features: stable Chrome supported
Array.prototype.includes in Dec 2015 and __in Jul 2016; stable Firefox
supported these in Dec 2015 and Mar 2017, respectively. I guess you could say
that these features were widely available in 2016, _just if you use Chrome_,
but that 's not a satisfying answer.

MDN pages:

[0] [https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes#Browser_compatibility)

[1] [https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Browser_compatibility)

Dates for corresponding browser versions drawn from the wikipedia pages:

[2]
[https://en.wikipedia.org/wiki/Firefox_version_history](https://en.wikipedia.org/wiki/Firefox_version_history)

[3]
[https://en.wikipedia.org/wiki/Google_Chrome_version_history](https://en.wikipedia.org/wiki/Google_Chrome_version_history)

