Question 23
Consider the following javascript program, and predict the output if executed.
new Promise((str1, str2) => { if (5 == "5") str1(5) else str2(8)}).then(d => { console.log("Checkpoint 4", d); throw new Error(20); return d * 5;}).then(d => { console.log("Checkpoint 2", d); return d;}, d => { console.log("Checkpoint 5", d.message); return d.message * 2;}).catch(e => { console.log("Checkpoint 3", e.message); return e.message * 2;}).finally(d => { console.log("Checkpoint 1", d); return d * 5;}).then(d => { console.log("Checkpoint 6", d); return d * 5;})