Javascript examples for Language Basics:Javascript Version
Make Javascript ES6 cross-browser detection by using new syntax () => {};
<html> <head> <title>isES6()</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){// w w w. j a v a 2 s . co m function isES6() { try { Function("() => {};"); return true; } catch(exception) { return false; } } document.body.innerHTML += "isES6: " + isES6(); } </script> </head> <body> </body> </html>