Inside the initial document, there is the subsequent content:
function func()
{
console.log("Func");
}
func();
function func1()
{
console.log("Func1");
}
module.exports.expFunc = func1;
The second file has the ensuing data:
var newFunc = require('./prac');
newFunc.expFunc();
Upon executing the second file, the resulting output is:
Func
Func1
What is the reason behind the execution of the first function from the second file even though only the second function is being exported?