---
title: "Discussion on \"setTimeout(0) Is Lying to You (and the Event Loop Can Prove It)\" | Hashnode"
description: "Discussion on \"setTimeout(0) Is Lying to You (and the Event Loop Can Prove It)\". Why  a Promise run before setTimeout(0)? See how the JavaScript event loop, microtask queue and task queue decide the order, with an interactive demo"
url: "https://hashnode.com/posts/js-event-loop-visualized/6aba51aa4303061031344571"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [setTimeout(0) Is Lying to You (and the Event Loop Can Prove It)](https://jsvisualized.hashnode.dev/js-event-loop-visualized?utm_source=hashnode&utm_medium=feed)

Why a Promise run before setTimeout(0)? See how the JavaScript event loop, microtask queue and task queue decide the order, with an interactive demo

Sep 28 · 4 min read · jsvisualized.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#event-loop](https://hashnode.com/tag/event-loop)
-   [#software-engineering](https://hashnode.com/tag/software-engineering)
-   [#visualization](https://hashnode.com/tag/visualization)
-   [#ai](https://hashnode.com/tag/ai)

## Written by

[Sahil Nasariwala](https://hashnode.com/@sahiln)

@sahiln · Mumbai, India

  
[View profile](https://hashnode.com/@sahiln)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
