7 ms·
ES7 brings two new features
- lyschoening 9y agoWe're at ECMAScript 2017 now. The author is one version behind.
- _Chief 9y agoJavaScript,where even the "newest version" is already outdated
- masklinn 9y agoThe committee is now using yearly releases, so the "newest version" is outdated every year in June. The 7th edition is ES2016, and was superseded by the 8th edition (ES2017) finalised in June 2017.
- apaprocki 9y agoI think it would be a bit more "correct" to say that each spec is outdated as soon as it is cut :) At least no one in the committee considers the last released spec "current" -- they prefer everyone point to the github repo.
- masklinn 9y agoES2017 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
- gushie 9y agoIt 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 9y agoThat seems like it would make it very challenging to assign a version upon release. And there's also the possibility of overlapping versions.
- vitus 9y agoRight. 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/Reference/Global_Objects/Array/includes#Browser_compatibility https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Browser_compatibility https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... 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
- corv 9y agoThe reason for the year is to shame browser vendors into adding support.
- larzang 9y agoIt's honestly pretty irrelevant. Even if management doesn't require you to still support IE11, you're still almost certainly going to have babel in your pipeline, which means you can use brand new features before browsers support them.
- kbody 9y agoIs this a joke? It's presented a bit as a joke, but not sure.
- jakub_g 9y agoThe 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 9y ago> 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
- Slackwise 9y agoStill waiting on TCO.
- CapacitorSet 9y agoThat is already in ES6, no?
- masklinn 9y agoYes, but only Webkit/Safari implements it.
- curtisblaine 9y ago== 75% of the Web.
- nkg 9y agoI will welcome ".include(a)" into my code in place of the awkward ".indexOf(a)!== -1". Better late than never, I guess.
- tomatsu 9y agoToo bad it was renamed. "Contains" was a much better name. "Contains" is used everywhere else - the DOM API included (Element.classList.contains).
- deleted 9y ago[deleted]
- runarberg 9y agoIf I remember correctly, the array methods `.includes`, `.every`, and `.some` were renamed because of collision with prototype.js's `.contains`, `.all`, and `.any` respectively.
- haukur 9y agoIt's very unfortunate that the APIs of libraries that extend JavaScript builtins affect the development of the language to this degree.
- eximius 9y agoThat 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 9y agoLots of websites still use Prototype.js. Magento still has it as a dependency. Don't want to break the web!
- eximius 9y agoWould it break the web though? Wouldn't they just override the native implementation with a JS one?
- Hurtak 9y ago> ['my','mom','hates','me'].indexOf('mom') // 1 > life.includes('girlfriend') // false That are some depressing code examples, is the author ok?
- coldtea 9y agoOr, you know, they are joking...
- h1d 9y agoNot exactly too funny as a joke.
- moomin 9y agoSerious 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 9y agoThey 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 9y agocool, can't wait to use these in 10 years when browser compatabilty catches up.
- brink 9y agoUse a JS compiler
- masklinn 9y agoAll 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.
- thethirdone 9y agoNo. Firefox and Chrome don't have proper tail call optimizations.
- amgin3 9y agoup 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 9y agoThat'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.
- devmunchies 9y agoI just tested both of these features in the latest Firefox and Chrome they both work already.
- janci 9y agoTwo more points for the javascript fatigue.
- Myrmornis 9y agoIs there any chance of comprehensions appearing in JS soon? That’s the main thing I miss from the coffeescript years.