ie8 does not support es6. In the IE browser, IE10 and below versions do not support es6 at all and cannot parse the syntax of es6, while IE11 can support some es6 features; you can check whether the IE browser supports es6 by judging whether it supports arrow functions. If not, Supporting arrow functions means that the browser does not support ES6.
The operating environment of this tutorial: Windows 7 system, ECMAScript version 6, Dell G3 computer.
ie8 does not support es6.
In the IE browser, IE10 and below versions do not support es6 at all and cannot parse the syntax of es6, while IE11 can support some es6 features.
Browser versions that support ES6 (summary table):
Versions not supported by | browsers | Partially supported versions | Supported versions |
---|---|---|---|
IE | 6-10 | 11 | |
Edge | 12-14 | 15-18, 79-87 | |
Firefox | 2-5 | 6-53 | 54-86 |
Chrome | 4-20 | 21-50 | 51-90 |
Safari | 3.1-7 | 7.1-9.1 | 10-13.1, 14, TP |
Opera | 10-12.1 | 15- 37 | 38-72 |
iOS Safari | 3.2-6.1 | 7-9.3 | 10-13.7, 14.2 |
Opera Mini | all | ||
Android Browser | 2.1-4.3 | 4.4-4.4.4 | 81 |
Opera Mobile | 12-12.1 | 59 | |
Chrome for Android | 87 | ||
Firefox for Android | 83UC | ||
Browser for Android | 12.12 | ||
Samsung Internet | 4 | 5-13.0 | |
QQ Browser | 10.4 | ||
Baidu Browser | 7.12 | ||
KaiOS Browser | 2.5 |
How to determine whether a browser supports ES6?
Implementation idea:
Determine whether a browser supports arrow functions. If arrow functions are not supported, it means that the browser does not support ES6.
The implementation steps are as follows:
1. Define a string and assign an arrow function to the string.
2. Use try catch to determine whether the new Function can be initialized successfully. If the arrow function
does not enter the catch, it means that the browser supports ES6; otherwise, the browser does not support ES6, as shown in the following example:
Example:
Example of detecting whether the browser supports ES6. Share
the test environment: IE, Chrome
document.write("Detection method of whether the browser supports ES6"); var arrowFunction ="var t = () => {};" ; try { f = new Function(arrowFunction); document.write("The current browser supports ES6!"); } catch (e) { document.write("ES6 is not supported! "+e); }