Problem Statement
What is the purpose of module.exports in Node.js?
Explanation
module.exports allows functions, objects, or values to be shared between files. It’s used with require() to import exported members into other modules.
Code Solution
SolutionRead Only
// math.js
module.exports.add=(a,b)=>a+b;
// app.js
const { add }=require('./math');
console.log(add(2,3));