Below is my example, i create a .js file let other .js file can use it as a Helper.
var Helper = {
print: function() {
console.log("test");
},
show: function() {
print();
}
}
module.exports = Helper;
In other .js file I can include Helper file like below
var Helper = require('./Helper.js');
Helper.print(); // i will get "test" on console.
However, if I do like blow, it cannot find print function in same Helper file.
var Helper = require('./Helper.js');
Helper.show();
What can I do to use functions which from same Helper js file?