---
title: "Discussion on \"setTimeout + Closures Interview Question 🔥\" | Hashnode"
description: "Discussion on \"setTimeout + Closures Interview Question 🔥\". In this blog, we are going to learn about a few interesting questions related to set timeout and closure. So let's start directly with an example.\nfunction x(){\n  var i = 1;\n  setTimeout(function(){\n   console.log(i);\n   },1000)\n}\nx();\n\nFrom the abov..."
url: "https://hashnode.com/posts/settimeout-closures-interview-question/64079ed2ea9e14f95bb7af19"
---

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

Discussion

# [setTimeout + Closures Interview Question 🔥](https://dailylearn.hashnode.dev/settimeout-closures-interview-question?utm_source=hashnode&utm_medium=feed)

In this blog, we are going to learn about a few interesting questions related to set timeout and closure. So let's start directly with an example. function x(){ var i = 1; setTimeout(function(){ console.log(i); },1000) } x(); From the abov...

Mar 7, 2023 · 5 min read · dailylearn.hashnode.dev  
Read the article

-   [#2articles1week](https://hashnode.com/tag/2articles1week)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#settimeout](https://hashnode.com/tag/settimeout)
-   [#closure](https://hashnode.com/tag/closure)

## Written by

[haresh lakhwani](https://hashnode.com/@Haresh9958)

@Haresh9958 · Ahemdabad India

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

Sr Software Engineer at GlobalLogic.

Experienced developer with a background in native Android development and cross-platform development with React Native. Strong collaborator with a focus on attention to detail and staying up-to-date with the latest technologies. Currently expanding knowledge in data structures and system design. Capable of delivering high-quality applications utilizing React and React Native.

## Responses 2

Markdown supported · ⌘↵ to post

[Randy willson](https://hashnode.com/@randy770)

[Mar 29, 2023](https://hashnode.com/posts/settimeout-closures-interview-question/64079ed2ea9e14f95bb7af19/comment/64248506ca4beba4126f5632)

Well done with explanation ✌️

[Ronika mathoor](https://hashnode.com/@ronika)

[Mar 11, 2023](https://hashnode.com/posts/settimeout-closures-interview-question/64079ed2ea9e14f95bb7af19/comment/640c7d16e1ece738019bcf44)

Easy understanding in this blog
