Promise 정리

created : 2020-04-07T11:22:09+00:00
modified : 2020-04-08T03:48:44+00:00

## Synchronous vs Asynchronous

Callback hell

CallEndpoint("api/getidbyusername/hotcakes", function(result) {
	CallEndpoint("api/getfollowersbyid/" + result.userID, function(result) {
		CallEndpoint("api/someothercall/" + result.followers, function(result) {
			CallEndpoint("api/someothercall/" + result, function(result) {
				// do something...
			});
		});
	});
});

Promise

Async, Await

References

The Great Escape from Callback Hell