Why does the local function with the same name not conflict or over write the imported function, I would have expected the local function to overwrite and be ran instead of the one imported by the require.
//Contents of app.js
var greet = require('./greet.js');
//local greet function, how do I call this one? And why does this not redefine the identifier greet
function greet() {
console.log('hi');
}
greet(); //Call greet in module
//Smashing the modules import of greet
var greet = function () {
console.log("Hello pal!");
}
greet();
and the other file is greet.js
var greet = function () {
console.log("Hello from module!");
}
module.exports = greet;