loveshenzhen06cal
Version:
自定义计算器
28 lines (25 loc) • 584 B
JavaScript
// // 加法
// function add(x, y) {
// return x + y
// }
// const name = 'i am jack';
// const goodList = ['apple', 'banana', 'pear'];
// module.exports = {
// addFunction: add,
// name: name,
// goodList: goodList
// }
// // 对上面的另一种写法 ,导出
// // exports.addFunction = add;
// // exports.name = name;
// // exports.goodList = goodList;
// // 方法二
// // module.exports = add;
;
const addFunction = (x, y) => {
return x + y;
}
const name = 'jack';
module.exports = {
addFunction: addFunction
}