exp-3
Wed Nov 06 2024 16:40:42 GMT+0000 (Coordinated Universal Time)
Saved by
@freefire
// Returns addition of two numbers exports.add = function (a, b) { return a+b;
};
// Returns difference of two numbers exports.subtract = function (a, b) { return a-b;
};
// Returns product of two numbers exports.multiply = function (a, b) { return a*b;
};
moduleExample.js
var calculator = require('./calculator'); var a=10, b=5;
console.log("Addition : "+calculator.add(a,b)); console.log("Subtraction : "+calculator.subtract(a,b)); console.log("Multiplication : "+calculator.multiply(a,b));\
content_copyCOPY
Comments