---
title: "Discussion on \"Hoisting in JavaScript\" | Hashnode"
description: "Discussion on \"Hoisting in JavaScript\". Before we dive into what Hoisting is let us go through an example and understand this phenomenon.\nINPUT -->\ngetName();\nconsole.log(x);\nvar x = 7;\nfunction getName(){\n  console.log(\"Siddhartha Sahu Blog\");\n}\n\nOUTPUT -->\nSiddhartha Sahu Blog\nundefined\n..."
url: "https://hashnode.com/posts/hoisting-in-javascript/63282214195e7dc741da49d2"
---

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

Discussion

# [Hoisting in JavaScript](https://siddharthasahu.hashnode.dev/hoisting-in-javascript?utm_source=hashnode&utm_medium=feed)

Before we dive into what Hoisting is let us go through an example and understand this phenomenon. INPUT --> getName(); console.log(x); var x = 7; function getName(){ console.log("Siddhartha Sahu Blog"); } OUTPUT --> Siddhartha Sahu Blog undefined ...

Sep 19, 2022 · 3 min read · siddharthasahu.hashnode.dev  
Updated Sep 23, 2022  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#hoisting](https://hashnode.com/tag/hoisting)
-   [#beginners](https://hashnode.com/tag/beginners)
-   [#interview](https://hashnode.com/tag/interview)
-   [#web-development](https://hashnode.com/tag/web-development)

## Written by

[Siddhartha Sahu](https://hashnode.com/@CallMeSahu)

@CallMeSahu

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

Learning Full Stack Web Development at NeoG Camp.

## Responses 1

Markdown supported · ⌘↵ to post

[Vidhu Gupta](https://hashnode.com/@vidhuguptaa)

[Sep 23, 2022](https://hashnode.com/posts/hoisting-in-javascript/63282214195e7dc741da49d2/comment/632e0a313ac18d0d78a00ba2)

This is very interesting. You have explained it with great clarity.
