- Notifications
You must be signed in to change notification settings - Fork1.1k
ECMAScript 6: Feature Overview & Comparison
License
rse/es6-features
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Copyright (c) 2015-2017 Ralf S. Engelschall <rse@engelschall.com> <@engelschall>
Partially based oncode snippets by Luke Hoban.
Licensed under MIT license.
This is the source of the websiterse.github.io/es6-features/,a small overview of currentECMAScript 6language features and a comparison to their oldECMAScript 5 equivalents.
Why was it setup? Is the ECMAScript 6 specification not enough?
It was setup by computer scientist and softwarearchitectRalf S. Engelschall in March 2015 in order topromote ECMAScript 6 in the software engineering projects around himand to have bookmarkable URLs at hand for referencing certainECMAScript 6 features. Additionally, creating this website was agood approach for Ralf S. Engelschall to learn the new ECMAScript 6features himself.
Where can I find the current browser support status quo for ECMASCript 6?
Have a look at the regularily updatedECMAScript compatibility table by kangax.There, especially notice the column "Babel + core-js" as this is what can be achievedtoday with transpiling (and that's fully sufficient for practice).
Where can I find the latest ECMAScript 6 standard?
The final ECMAScript 6 standard (ECMA-262) was published in June 2015. You can find thestandard onecmascript.org.
How can I use ECMAScript 6 if my JavaScript runtime still does not support it?
Use the awesomeBabel transpiler. For Node.js/io.js environmentsjust use its tricky
require
hook. For browser environments use Babel in conjunctionwithBrowserify and itsBabelify plugin. Forother tools seeUsing Babel.If you want to see pre-integrated scenarios, check out our sibling projectes6-support for various code examples!Why does the website default use the "reduced" syntactic sugar style (without semicolons)for ECMAScript 6 and the "traditional" syntactic sugar style (with semicolons) for ECMAScript 5?
ECMAScript since its earliest days supported automatic semicoloninference/insertion, of course. But people coding ECMAScript 5 started itin an era where lots of tools (especially source code compressors)had problems when semicolons where left out from the source code. Asa consequence, most ECMAScript 5 coders maintained the traditionalcoding style with semicolons as the syntactic sugar, although in mostof the cases they are not necessary. But this era is gone today.Both ECMAScript 6 and all tools (including compressors) perfectlysupport automatic semicolon inference/insertion nowadays. As a consequence,ECMAScript 6 coders nowadays can get rid of nearly allsemicolons and remove clutter from their source code. Ralf S. Engelschall is a strong promoter of reducingsource code to its bare minimum. Hence, in his personal opinionECMAScript 6 should be coded with as less syntactic sugar as possibleand hence without semicolons. But if you disagree, just switch theshown style on the website. If you even need to enforce a particularstyle for both ES6 and ES5 code snippets in your bookmarks, just useone of the following URLs:ES6-Features (reduced style) orES6-Features (traditional style)
I still don't understand: why should I use ECMAScript 6? ECMAScript 5 looks sufficient.
ECMAScript 5 is a nice and decent programming language, of course. Butbecause of its history, it has some nasty aspects which ECMAScript 6finally resolves. As programming never is just about getting the necessaryfunctionality done, it is advised to also use the best language,too. ECMAScript 6's language design is cleaner than ECMAScript 5,its syntax increases the expressiveness of your code, it decreases thenecessary boilerplate code (e.g.
function
vs. arrow syntax) and itespecially let you get rid of some very nasty but required hacks andworkarounds from the ECMAScript 5 era (e.g.var self = this
).So, ECMAScript 5 might be sufficient, but ECMAScript 6 neverthelessis an important improvement.I've found a mistake, how can I contribute?
The source is the file
features.txt
, everything else onrse.github.io/es6-features/ isjust generated out of it. Fork this project on Github, edit the filefeatures.txt
and then please send a pull request.Do you know more such ECMAScript 6 feature lists?
- ECMAScript 6 Features (by Luke Hoban)
- Learn ES2015 - A detailed overview of ECMAScript 6 features (by Babel team)
- ECMAScript 6 Cheatsheet (by Erik Moeller)
- First Steps with ECMAScript 6 (by Axel Rauschmayer)
- JS Features (by Hemanth.HM)
- Minimalist examples of ES6 functionalities (by Hemanth.HM)
- Understanding ECMAScript 6 (by Nicholas C. Zakas)
About
ECMAScript 6: Feature Overview & Comparison
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.