Old and New Browsers
Code doesn't work in old browsers
The code we've been looking at in this course is not supported by older browsers. Older browsers that were developed prior to the release of ES6 were developed to support the version of JavaScript at the time (which was ES5.1). If you try running any ES6 code in an older browser, it won't work.
It makes sense that code doesn't work in older browsers that were developed prior to the release of ES6, but there are some browsers that have been released after ES6 that don't support the new JavaScript syntax and functionality yet.
Try using an arrow function in your code and opening it up in IE 11, and it won't work. There'll be an error on the console saying that it doesn't recognize the syntax.
Most of us don't think much about the browser and all it can do...until it doesn't work! But really, browser makers have a tough time. Think about HTML, CSS, and JavaScript - these languages are fluid and are always improving. Browser makers have to keep up with all of these changes.
But how do they know about these changes?
They learn (or actually build) the language specifications!
Just like theWorld Wide Web Consortium (W3C)is the standards body for things like HTML, CSS, and SVG,Ecma Internationalis an industry association that develops and oversees standards like JavaScript and JSON. You can find the specifications for ES6here.
Further info
Ecma International is an important industry community and definitely worth checking out in more detail:
- https://en.wikipedia.org/wiki/Ecma_International
- http://www.ecma-international.org/memento/index.html
NOTE:The code we've been looking at in this course is not supported by older browsers. Older browsers that were developed prior to the release of ES6 were developed to support the version of JavaScript at the time (which was ES5.1). If you try running any ES6 code in an older browser, it won't work.