Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Test if ES6 is ~fully supported
var supportsES6 = function() {
try {
new Function("(a = 0) => a");
return true;
catch (err) {
return false;
Copy link

bendc commented Aug 26, 2016

@triblondon Yup, the critical test is the a = 0 (all browsers supporting default parameters have a fairly complete support of ES6 -- for example, Edge 13 will be rejected by this test despite a decent ES6 coverage).

Copy link

kenberkeley commented Mar 1, 2019

  if (typeof Symbol === 'undefined') {
    document.write('<script crossorigin="anonymous" src=",es7&flags=gated"><\/script>')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment