UNPKG

loveshenzhen06cal

Version:

自定义计算器

28 lines (25 loc) 584 B
// // 加法 // 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; 'use strict'; const addFunction = (x, y) => { return x + y; } const name = 'jack'; module.exports = { addFunction: addFunction }