How to chain promises one after another for unknown amount of times? This example shows how chain $timeout
using .then()
Each $timeout
change the color of a block in a random delay time.
And each one happens one by one for dynamic number of times.