Promiesの逐次実行
const series = promises => new Promise((resolve, reject) => {
let len = promises.length
let i = 0
let results = []
const doPromise = () =>
promises[i]()
.then(res => {
i++
results.push(res)
return i < len ? doPromise() : resolve(results)
})
doPromise()
})