Promises as Values

from blog software is fun, | ↗ original
I was recently working on a small JavaScript project in which I needed to perform several asynchronous operations sequentially. I had a collection of images on a page and I needed to fade each of them out one at a time. I ended up with a nice technique using Promises. Let’s suppose we have a function that fades out an image given a selector and a...