3 ms·
timeout IDs are similar in a sense. By having the promise as an object, you can do neat things to modify program control flow as a separate concern from resolvi
by jasondenizac 14y ago
timeout IDs are similar in a sense. By having the promise as an object, you can do neat things to modify program control flow as a separate concern from resolving a particular asynchronous operation. Sure, you can compose promises, just like you might with callback-oriented code. But you can also do neat things like await an object graph of mixed synchronous and promised values, eg: https://npmjs.org/package/resolved https://npmjs.org/package/resolved