lukehaas / RunJS

RunJS is a JavaScript playground for macOS, Windows and Linux. Write code with instant feedback and access to Node.js and browser APIs.
https://runjs.app
2.05k stars 44 forks source link

console.log timing wrong, simple code runs with wrong output, whereas in console, chrome the output of the same code is right #645

Closed visaruruqi closed 1 month ago

visaruruqi commented 1 month ago

RUN THIS IN RUNJS you will see a wrong output

for (let i = 1; i <= 100; i++) { if (i % 3 == 0 && i % 5 == 0) { console.log("FizzBuzz"); } else if (i % 3 == 0) { console.log("Fizz"); } else if (i % 5 == 0) { console.log("Buzz"); } else { console.log(i); } }

run the same in chrome, it will come just with right order

lukehaas commented 1 month ago

Here is a side-by-side comparison of this code in RunJS and the chrome console:

Screenshot 2024-10-07 at 18 10 47

visaruruqi commented 1 month ago

RunJS Version 2.12.1 (2.12.1)

Screenshot 2024-10-07 at 22 30 27
visaruruqi commented 1 month ago

https://github.com/user-attachments/assets/645736e3-888d-416a-a3e7-e5cad539231b

found the guilty feature