---
title: "Discussion on \"First understand scope; said old closure\" | Hashnode"
description: "Discussion on \"First understand scope; said old closure\". let age = 10;\nconsole.log(age); // logs 10\n\nScope manages the accessibility of variables. Since the definition of age (line # 1) & accessing it (line # 2) are within the same scope. It works!\n\nIn JavaScript, a new scope is created by a function or a ..."
url: "https://hashnode.com/posts/first-understand-scope-said-old-closure/63975673c5d85e2aca0dd357"
---

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

Discussion

# [First understand scope; said old closure](https://naumanzafar.dev/first-understand-scope-said-old-closure?utm_source=hashnode&utm_medium=feed)

let age = 10; console.log(age); // logs 10 Scope manages the accessibility of variables. Since the definition of age (line # 1) & accessing it (line # 2) are within the same scope. It works! In JavaScript, a new scope is created by a function or a ...

Dec 12, 2022 · 2 min read · naumanzafar.dev  
Updated Jan 27, 2023  
Read the article

-   [#closure](https://hashnode.com/tag/closure)
-   [#closures-in-javascript](https://hashnode.com/tag/closures-in-javascript)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#scope-is-javascript](https://hashnode.com/tag/scope-is-javascript)

## Written by

[Nauman Zafar](https://hashnode.com/@naumanzafarch)

@naumanzafarch · Lahore, Punjab, Pakistan

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

#javascript #frontend #engineering #management

Software Engineer, all-willing to unlearn and relearn!

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
