I think that code works as expected because, regardless of the time each promise takes, promise.all returns the results in the same order as the input