Calling function within a promise


I’m trying to call a function within a promise and I keep getting the error of “Cannot read property ‘getPlaceId’ of undefined”

Can someone please explain why?

const that = this;

write this code as the first line before

var promise = new Promise...


Omg that was such a…error. Thank you so much!!


Just convert your function()… Into an arrow function and you will not need that