-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG with reassigning #3699
Comments
This isn't a bug. However, one solution to this could be to return an object that holds a reference to the current // sum.js
function sum(a) {
console.log('test');
exports.sum = function(b) {
console.log(a + b);
};
}
exports.sum = sum; // main.js
var obj = require('./sum');
obj.sum(10);
obj.sum(15);
// outputs:
// test
// 25 |
What if i want call sum one time from two other files? @mscdex |
If you need separate instances, then return |
~ DELETED ~
The text was updated successfully, but these errors were encountered: