+ 10
ASYNC JS: ES6 Promise.all method - unexpected output dilemma.
My question is about why there are two expected outputs from sololearn challenges in this chunk of ajax code but when I test in the debugger this gives me only [foo, car] as output? const a = new Promise((res, rej) => { //n1 setTimeout(() => res('foo'), 300); }); const b = new Promise((res, rej) => { setInterval(() => rej('bar'), 100); res('car'); }); Promise.all([a, b]).then((race) => { console.log(race); }).catch((crash) => { console.log(crash); }); Right answers: [foo, car] ['bar', 'car'] - why this?
2 odpowiedzi
+ 11
I have not much idea about js promises but i can help you with this link..
https://stackoverflow.com/questions/55979096/ajax-promise-all-method-unexpected-output-dilemma
+ 8
DPP
Please donot spam.
https://www.sololearn.com/discuss/1316935/?ref=app