---
title: "Discussion on \"Closure\" | Hashnode"
description: "Discussion on \"Closure\". After a function finishes executing, the local variables of the function are no longer available.\n\nWhat if we want to keep the state of the variables between multiple function calls?\n\nThat's where JavaScript closures come in.\nA closure is when an inn..."
url: "https://hashnode.com/posts/closure/645444fe41e28144e607679b"
---

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

Discussion

# [Closure](https://alexkang.hashnode.dev/closure?utm_source=hashnode&utm_medium=feed)

After a function finishes executing, the local variables of the function are no longer available. What if we want to keep the state of the variables between multiple function calls? That's where JavaScript closures come in. A closure is when an inn...

May 4, 2023 · 2 min read · alexkang.hashnode.dev  
Updated May 11, 2023  
Read the article

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

## Written by

[Alex Kang](https://hashnode.com/@alexkang)

@alexkang

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

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
