---
title: "Discussion on \"Wondering how the Closure ❤️ and setTimeout ⏳ in the For-loop Question can blow your mind?\" | Hashnode"
description: "Discussion on \"Wondering how the Closure ❤️ and setTimeout ⏳ in the For-loop Question can blow your mind?\". This article will cover the trickiest and the most asked question in interviews of how closure and setTimeout works in the for loop."
url: "https://hashnode.com/posts/wondering-how-the-closure-and-settimeout-in-the-for-loop-question-can-blow-your-mind/6401bdbc8d737f2db056aa89"
---

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

Discussion

# [Wondering how the Closure ❤️ and setTimeout ⏳ in the For-loop Question can blow your mind?](https://riyatiwari.hashnode.dev/wondering-how-the-closure-and-settimeout-in-the-for-loop-question-can-blow-your-mind?utm_source=hashnode&utm_medium=feed)

This article will cover the trickiest and the most asked question in interviews of how closure and setTimeout works in the for loop.

Mar 3, 2023 · 9 min read · riyatiwari.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#closure](https://hashnode.com/tag/closure)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#js](https://hashnode.com/tag/js)
-   [#iwritecode](https://hashnode.com/tag/iwritecode)

## Written by

[Riya Tiwari](https://hashnode.com/@riyatiwarii)

@riyatiwarii · India

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

Software Developer

Software Developer

## Responses 4

Markdown supported · ⌘↵ to post

[Ankit Singh](https://hashnode.com/@ankit9761)

[Mar 4, 2023](https://hashnode.com/posts/wondering-how-the-closure-and-settimeout-in-the-for-loop-question-can-blow-your-mind/6401bdbc8d737f2db056aa89/comment/6402e5c96cc7b7a22094b320)

Wow nicely explained i was laughing in between enjoyed the writeup 😂

[Riya Tiwari](https://hashnode.com/@riyatiwarii)

[Mar 5, 2023](https://hashnode.com/posts/wondering-how-the-closure-and-settimeout-in-the-for-loop-question-can-blow-your-mind/6401bdbc8d737f2db056aa89/comment/6402e5c96cc7b7a22094b320#reply-6404110787595bb6fc883a7f)

Haha! glad to hear that you had a happy reading! 😁thank you!

[Atul Singh](https://hashnode.com/@atulsinghatul)

[Mar 3, 2023](https://hashnode.com/posts/wondering-how-the-closure-and-settimeout-in-the-for-loop-question-can-blow-your-mind/6401bdbc8d737f2db056aa89/comment/64020513a50f11a2517bf5b5)

Great explanation 👌 👍 👏

[Riya Tiwari](https://hashnode.com/@riyatiwarii)

[Mar 4, 2023](https://hashnode.com/posts/wondering-how-the-closure-and-settimeout-in-the-for-loop-question-can-blow-your-mind/6401bdbc8d737f2db056aa89/comment/64020513a50f11a2517bf5b5#reply-6402bed2a50f11a2517c075a)

Thank you so much!

[Aman Kumar](https://hashnode.com/@amanisokay)

[Mar 3, 2023](https://hashnode.com/posts/wondering-how-the-closure-and-settimeout-in-the-for-loop-question-can-blow-your-mind/6401bdbc8d737f2db056aa89/comment/6401cde16cc7b7a220948a09)

it was great

[Riya Tiwari](https://hashnode.com/@riyatiwarii)

[Mar 3, 2023](https://hashnode.com/posts/wondering-how-the-closure-and-settimeout-in-the-for-loop-question-can-blow-your-mind/6401bdbc8d737f2db056aa89/comment/6401cde16cc7b7a220948a09#reply-6401d13a6cc7b7a220948aec)

Glad to hear from you, thank you.
