Question 27
Consider the following JavaScript program, and predict the output if executed.
new Promise((res, rej) => { if (9 === "9") rej(10) else res(20)}).then(d => { console.log("hello 1", d); throw new Error(20); return d * 10;}).then(d => { console.log("hello 2", d); return d;}).catch(e => { console.log("hello 3"); return e * 10;}).finally(d => { console.log("hello 4", d); return d * 10;}).then(d => { console.log("hello 5", d); return d * 10;})