class TestClass {
async profile() {
await ClientData (BASE_URL, function Data (response) { // ClientData is using `export async function` in another file that has function for getting body from a website url
return response
})
}
}
const Client = new TestClass();
async function test() {
console.log(await Client.profile().Data());
}
test();
It always give an output (node:5424) UnhandledPromiseRejectionWarning: TypeError: Client.run(...).Data is not a function
, I do tried one thing previously with this:
async function test() {
console.log(await Client.profile().Data);
}
test();
Instead of getting the output, it just gives me output undefined