Category : es6-promise

In the following javascript code, why does the error (generated by the assignment to an non-existing object property inside the promise) not get caught by the .catch() on the promise, but does get caught by the window.onunhandledrejection function? I would like to be able to catch errors in my promises using .catch() even if they ..

Read more

I’m trying to build my own Promise to improve my understanding of Promise in javascript. I’m currently stuck at the .then method and I’d like to ask 2 things: Why does when I console.log out callback, it gives me an empty function definition? In the documentation for .then here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then , it says that the ..

Read more

from within a Google API maps places call, I also need to retreive place coords: if (status != google.maps.places.PlacesServiceStatus.OK) { callback(data); } else { var geocoder = new google.maps.Geocoder(); } for (var i = 0; i < predictions.length; i++) { let coords = geocoder.geocode({ ‘placeId’: predictions[i].place_id, }, function (responses, status) { if (status == ‘OK’) ..

Read more