Question 13
Consider the following javascript program.
new Promise((resolve, reject) => { const score = 0.45; if (score >= 0.5) { resolve(score); } else { reject(new Error("Score too low")); }}).then(data => { console.log("Stage A:", data); return data * 10;}).catch(error => { console.log("Stage B:", error.message); return 3;}).then(data => { console.log("Stage C:", data); if (data < 5) { throw new Error("Value below threshold"); } return data + 2;}).then(data => { console.log("Stage D:", data); return data / 2;}).catch(error => { console.log("Stage E:", error.message); if (error.message === "Value below threshold") { return "Recovered"; } throw error;}).then(data => { console.log("Stage F:", data); if (data === "Recovered") { return 10; } return data * 4;}).finally(() => { console.log("Stage G: Cleanup completed");});What will be the output of the above program on the browser’s console?