Find the output with timeout 0

The code is : console.log(“first”); setTimeout(function() { console.log(“second”); }, 0); console.log(“third”);console.log(“first”); setTimeout(function() { console.log(“second”); }, 0); console.log(“third”);console.log(“first”); setTimeout(function() { console.log(“second”); }, 0); console.log(“third”); Output is : first third second Explanation