---
title: "Discussion on \"Mastering JavaScript Variables: Understanding the Difference between let, const, and var\" | Hashnode"
description: "Discussion on \"Mastering JavaScript Variables: Understanding the Difference between let, const, and var\". Use let and const whenever you require block scope.\n\nUse var when you want a function scope."
url: "https://hashnode.com/posts/mastering-javascript-variables-understanding-the-difference-between-let-const-and-var/64a6cda7e2ae61749a908d26"
---

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

Discussion

# [Mastering JavaScript Variables: Understanding the Difference between let, const, and var](https://mariyazaveri.hashnode.dev/mastering-javascript-variables-understanding-the-difference-between-let-const-and-var?utm_source=hashnode&utm_medium=feed)

Use let and const whenever you require block scope. Use var when you want a function scope.

Jul 6, 2023 · 7 min read · mariyazaveri.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#variables](https://hashnode.com/tag/variables)
-   [#javascript-framework](https://hashnode.com/tag/javascript-framework)
-   [#var-let-const](https://hashnode.com/tag/var-let-const)
-   [#variable-declaration](https://hashnode.com/tag/variable-declaration)

## Written by

[Mariya Zaveri](https://hashnode.com/@Mariyacodes)

@Mariyacodes · India

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

I'm a full stack MERN developer

I'm a full stack MERN developer.

## Responses 1

Markdown supported · ⌘↵ to post

[Burhan bs](https://hashnode.com/@Burhanbs)

[Jul 6, 2023](https://hashnode.com/posts/mastering-javascript-variables-understanding-the-difference-between-let-const-and-var/64a6cda7e2ae61749a908d26/comment/64a701487e8c04130f7fd7da)

Clearly expalined the concepts it was awesome

[Mariya Zaveri](https://hashnode.com/@Mariyacodes)

[Jul 6, 2023](https://hashnode.com/posts/mastering-javascript-variables-understanding-the-difference-between-let-const-and-var/64a6cda7e2ae61749a908d26/comment/64a701487e8c04130f7fd7da#reply-64a7016a7e8c04130f7fd7e6)

Thanks for the kind words
