I was trying to create a module for node.js and i noticed something. Example
function Example() {
this.property = "something";
}
Example.prototype.run = function() {
console.log('hello world')
}
module.exports = Example;
with this code it say's that there's no method run. I need it to declare like
Example.prototype.run = function run() {}
to work. Why is that happening ?
var Example = require('./example.js'); new Example().run();