---
title: "Discussion on \"Part 1: What Actually Happens When You Declare a Variable (or Function)\" | Hashnode"
description: "Discussion on \"Part 1: What Actually Happens When You Declare a Variable (or Function)\". Real mechanism behind var, let, const, and function declarations. 2 phases, 3 binding states, two error types and why hoisting is the wrong word."
url: "https://hashnode.com/posts/what-happens-when-you-declare-a-variable-in-javascript/6a0a06ad3104e2aff0c4d78a"
---

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

Discussion

# [Part 1: What Actually Happens When You Declare a Variable (or Function)](https://srekaravarshan.hashnode.dev/what-happens-when-you-declare-a-variable-in-javascript?utm_source=hashnode&utm_medium=feed)

Real mechanism behind var, let, const, and function declarations. 2 phases, 3 binding states, two error types and why hoisting is the wrong word.

May 17 · 22 min read · srekaravarshan.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#webdev](https://hashnode.com/tag/webdev)
-   [#programming-blogs](https://hashnode.com/tag/programming-blogs)
-   [#technical-deep-dive](https://hashnode.com/tag/technical-deep-dive)

## Written by

[Srekaravarshan N K](https://hashnode.com/@srekaravarshan)

@srekaravarshan

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

Frontend Developer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
