ECMAScript6兼容性
兼容性查看:http://kangax.github.io/compat-table/es6/
可使用babel(browser.js)来进行在线编译
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script src="browser.js" charset="utf-8"></script> <script type="text/babel"> let a=12; let b=5; alert(a+b); </script> </head> <body> </body> </html>
引入browser.js
将script标签中的type设置为"text/babel"