I have the following code. I want to use the prototype keyword as I want to call method functions and not class methods, why does this give me an error? If I remove the prototype call this works. How can I write this code so I'm able to use instances not class methods?
//app.js
var MyTest = require('./MyTest')
var myTestInstance = new MyTest()
myTestInstance.testFunction(function(reply){
console.log(reply)
})
//MyTest.js
module.exports = function() {
function MyTest() {}
MyTest.prototype.testFunction = function(cb) {
cb('hello')
}
return MyTest
}