Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // math.js
- module.exports.add = (x, y) => {
- return x + y;
- }
- module.exports.multiply = (x, y) => {
- return x * y;
- };
- # app.js
- const math = require('./math.js');
- console.log(math.add(2, 3));
- // math.js
- module.exports = {
- add: (x, y) => {
- return x + y;
- },
- multiply: (x, y) => {
- return x * y;
- }
- };
- # app.js
- const math = require('./math.js');
- console.log(math.add(2, 3));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement