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