3 ms·
The hardest part for me when I was new to Promises was that multi-layer promises would magically vanish. It was so counter-intuitive from every other programmin
by ballenf 9y ago
The hardest part for me when I was new to Promises was that multi-layer promises would magically vanish. It was so counter-intuitive from every other programming paradigm — nested loops, deep/complex objects, and functional closures.
I lost several days struggling against the concept until realizing that Promises were intended and designed to work differently than every other aspect of the language.
Can you imagine the language stripping out a nested returned function and instead executing it and returning the value? That’s what Promises will do.