I have value inside callback function and couldn’t return successfully.
async pos(convertedCodeDBSearch) {
var dd;
const x = await idealPostcodes.lookupAddress(convertedCodeDBSearch, function (error, searchResults) {
return searchResults.result.hits[1];
});
console.log('x', x);
}
I need to return searchResults.result.hits[1];
from function.
Here is the code,
Thank you.