You still have the problem with an array being returned though - it's ugly. Named properties would be much nicer. The specific purpose would be to avoid this:
Promise .all(proms) .then(data => { let a = data[0] let b = data[1] let c = data[1] doSomethingWith(a) doSomethingWith(b) doSomethingWith(c) }) .catch(console.log)
And replace it with this:
Promise .all(proms) .then(data => { doSomethingWith(data.a) doSomethingWith(data.b) doSomethingWith(data.c) }) .catch(console.log)
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You still have the problem with an array being returned though - it's ugly. Named properties would be much nicer. The specific purpose would be to avoid this:
And replace it with this: