---
title: "Discussion on \"The closures question that trips up almost every React interview\" | Hashnode"
description: "Discussion on \"The closures question that trips up almost every React interview\". If there's one JavaScript question that shows up in almost every frontend interview in some form, it's this one:\nfor (var i = 0; i < 3; i++) {\n  setTimeout(() => console.log(i));\n}\n\nWhat does this log"
url: "https://hashnode.com/posts/the-closures-question-that-trips-up-almost-every-react-interview/6a7ecfe5f7027efc47475a37"
---

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

Discussion

# [The closures question that trips up almost every React interview](https://101beardo.hashnode.dev/the-closures-question-that-trips-up-almost-every-react-interview?utm_source=hashnode&utm_medium=feed)

If there's one JavaScript question that shows up in almost every frontend interview in some form, it's this one: for (var i = 0; i < 3; i++) { setTimeout(() => console.log(i)); } What does this log

Aug 14 · 3 min read · 101beardo.hashnode.dev  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#interview](https://hashnode.com/tag/interview)
-   [#webdev](https://hashnode.com/tag/webdev)

## Written by

[Tarun Sharma](https://hashnode.com/@101beardo)

@101beardo · Bengaluru, India

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

React.js Frontend Web Developer | Next.js Specialist

3 years of experience building production SaaS platforms, enterprise web apps, and cross-platform mobile apps using React.js, Next.js, and TypeScript.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
