Question PRG-JS-0051
MediumWhat is the output of this program?
const p = new Promise((res, rej) => { rej("bad"); res("good"); });
p.then(v => console.log("ok", v)).catch(e => console.log("err", e));
- A.
err bad
- B.
ok good
- C.
Sign up free to see the answer and a step-by-step explanation.