Thanks for having taken the time to write this, great post.
Just a couple of things that they are not correct:
When you wrote the pseudo code to describe Promise.all, you wrote:
then runs all of them simultaneously; which it's not true, as promises given to Promise.all have already started
The "correct" example you wrote for (9), is not entirely OK, it should be like follows:
request(opts).catch(err=>err.statusCode===400?request(opts):Promise.reject(err))// you missed rejecting in your example.then(r=>r.text()).catch(err=>console.error(err));
Yes I agree, I think I tried to convey that it doesn't do any sort of batch execution, but then promises by design run the moment they are created. I think I should have an additional tip which clarifies about how promises run.
Whoops, missed that, corrected it :)
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.
Hi Kushan,
Thanks for having taken the time to write this, great post.
Just a couple of things that they are not correct:
Hey Mauro,
Thanks for giving the feedback.
Yes I agree, I think I tried to convey that it doesn't do any sort of batch execution, but then promises by design run the moment they are created. I think I should have an additional tip which clarifies about how promises run.
Whoops, missed that, corrected it :)