- 1
Bad Promises Tutorial
It's confusing and unhelpful to describe promises as alternative to setTimeout, and then use BOTH in the same example: function asyncFunc(work) { return new Promise(function(resolve, reject) { if (work === "") reject(Error("Nothing")); setTimeout(function() { resolve(work); }, 1000); }); }
2 Antworten
+ 1
Better fetching from an RESTful API
Expand the Async series and learn from here :
https://code.sololearn.com/WKKkpq0efxai/?ref=app
0
Where did you find this bad promises tutorial?
Promises are not an alternative to setTimeout... but setTimeout is usually used in promises tutorial to simulate async long time operations ^^