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即可
时间: 2024-11-02 10:45:45