package.json:
"devDependencies": {
"babel-cli": "^6.18.0",
"babel-core": "^6.18.2",
"babel-plugin-transform-es2015-arrow-functions": "^6.8.0",
"babel-preset-es2015": "^6.18.0"
}

需要依赖以上包文件


编写script.js:
'use strict';

let breakfast = (dessert, drink) => dessert + drink;

执行命令 babel script.js -o script-compiled.js
即可


相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2021-12-01
  • 2021-09-23
  • 2021-09-19
  • 2021-12-17
猜你喜欢
  • 2021-04-21
  • 2021-06-01
  • 2022-12-23
  • 2021-08-26
  • 2022-01-02
  • 2022-03-04
  • 2021-06-14
相关资源
相似解决方案