MyFunc1.js :
function MyFunc1(){
this.client = new myClient();
var scheduleService = new ScheduleService();
scheduleService.updatesometing(this.funcinsideFunc1);
}
MyFunc1.prototype.funcinsideFunc1 = async function() {
var self = this;
return new Promise((resolve, reject) => {
self.client.call() // error at this line Cannot read property 'call' of undefined
}
}
ScheduleService.js :
ScheduleService.prototype.updateSomething = async function(func1){
var result = await Promise.resolve(func1());
}
The above code produces the following error:
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'call' of undefined
on the line as specified in the comment in MyFunc1.js
What is the correct way to pass and execute this function?