Skip to content

Instantly share code, notes, and snippets.

Embed
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;
}
}();
@kenberkeley
Copy link

kenberkeley commented Mar 1, 2019

<html>
<head>
  <script>
  if (typeof Symbol === 'undefined') {
    document.write('<script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js?features=es6,es7&flags=gated"><\/script>')
  }
  </script>
</head>
<body>
</body>
</html>

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