InterviewSolution
Saved Bookmarks
| 1. |
What is the purpose of module.exports? |
|
Answer» This is used to expose functions of a PARTICULAR MODULE or file to be used elsewhere in the project. This can be used to encapsulate all SIMILAR functions in a file which further improves the project structure. Thus using module.exports we can use these functions in some other file: const { getSolutionInJavaScript, getSolutionInPython} = require("./utils") |
|