The code below runs without an error, but its result is wrong. Which statement correctly identifies the bug?
function showSpinner() { console.log("spinner shown"); }
function render(data) { console.log("render", data); }
setTimeout(showSpinner, 0); // show the spinner "first"
Promise.resolve(["Asha", "Ravi"]).then(render); // cached data, already available
Microtasks always beat timer tasks queued in the same turn. Things that must happen first should simply run first, synchronously.