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...
1 Like

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

1 Like

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

1 Like