javascript promise编程 在loop中使用promise: https://stackoverflow.com/questions/17217736/while-loop-with-promises