Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. // math.js
  2. module.exports.add = (x, y) => {
  3. return x + y;
  4. }
  5.  
  6. module.exports.multiply = (x, y) => {
  7. return x * y;
  8. };
  9.  
  10. # app.js
  11. const math = require('./math.js');
  12. console.log(math.add(2, 3));
  13.  
  14. // math.js
  15. module.exports = {
  16. add: (x, y) => {
  17. return x + y;
  18. },
  19. multiply: (x, y) => {
  20. return x * y;
  21. }
  22. };
  23.  
  24. # app.js
  25. const math = require('./math.js');
  26. console.log(math.add(2, 3));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement