Problem Statement
What is the purpose of module.exports?
Explanation
module.exports defines what values or functions a module exposes to other files. It allows encapsulation and reusability of code across different parts of an application.
Code Solution
SolutionRead Only
// math.js
module.exports.add = (a,b)=>a+b;
// app.js
const math=require('./math');
console.log(math.add(2,3));