Using Fetch API with Promise.all
问题 my aim is to fetch data from two URLs and perform an action only when both have come back successfully. On the other hand i want to return an error if either of them fail. I have played around with my code and managed to get the desired effect. My question is, is there a more efficient, succinct way of achieving the same functionality? Helper functions let status = (r) => { if (r.ok) { return Promise.resolve(r) } else { return Promise.reject(new Error(r.statusText)) } } let json = (r) => r