[nodejs] Re: What is the below express router doing

2017-09-07 Thread Zlatko
Hi, On Wednesday, September 6, 2017 at 4:15:19 PM UTC+2, Rohan Pota wrote: > > > 1. How does `Promise.all()` work ? > Promise.all works like this: you give it *an array* of promises, and it returns a

[nodejs] Re: What is the below express router doing

2017-09-07 Thread vito
1. The Promise.all() method *returns a single Promise that resolves when all of the promises in the iterable argument have resolved or when the iterable argument contains no promises. It rejects with the reason of the first promise that rejects.[1]* so it will return a promise when User.findByI