Question from the Node.js test

Include a module in NodeJS

Easy

How to include the followingMathModule.js module in the main file? :

// MathModule.js
module.exports = function () {
  return {
    addition       : (a, b) => a + b,
    soustration    : (a, b) => a - b,
    multiplication : (a, b) => a * b,
    division       : (a, b) => a / b
  };
};
Author: Jean-marie CléryStatus: PublishedQuestion passed 755 times
Edit
1
Community EvaluationsNo one has reviewed this question yet, be the first!