What does ".then" mean in JavaScript?
-
What does ".then" mean in JavaScript? Consider this snippet of code:
return ajaxService.request('post', 'api/{ticketId}/alt-forms/getSatelliteMapUrl', geoCodedata, { failureMessage: 'Failed to Geocode SatMap/PDF'})
.then(function (satelliteMapData, data) {Is the ".then" comment attached immediately to the previous "return" statement? If so, how? If not, then would the functionality of this JavaScript bit not be impacted if I put an "alert" statement immediately before the ".then" statement and immediately after the "return" statement?
-
What does ".then" mean in JavaScript? Consider this snippet of code:
return ajaxService.request('post', 'api/{ticketId}/alt-forms/getSatelliteMapUrl', geoCodedata, { failureMessage: 'Failed to Geocode SatMap/PDF'})
.then(function (satelliteMapData, data) {Is the ".then" comment attached immediately to the previous "return" statement? If so, how? If not, then would the functionality of this JavaScript bit not be impacted if I put an "alert" statement immediately before the ".then" statement and immediately after the "return" statement?
-
What does ".then" mean in JavaScript? Consider this snippet of code:
return ajaxService.request('post', 'api/{ticketId}/alt-forms/getSatelliteMapUrl', geoCodedata, { failureMessage: 'Failed to Geocode SatMap/PDF'})
.then(function (satelliteMapData, data) {Is the ".then" comment attached immediately to the previous "return" statement? If so, how? If not, then would the functionality of this JavaScript bit not be impacted if I put an "alert" statement immediately before the ".then" statement and immediately after the "return" statement?
Promises[^] Promises/A+[^] JavaScript Promises ... In Wicked Detail - Matt Greer[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer