---
title: "Discussion on \"How to declare JavaScript variables: a look at let, const, and var\" | Hashnode"
description: "Discussion on \"How to declare JavaScript variables: a look at let, const, and var\". With the old JavaScript, we had only one way to declare a variable, and that was with var, like var x = 10. It will create a variable called x and assign a value 10 to it. Now with modern ES6 JavaScript, we have 3 different ways to declare a variable..."
url: "https://hashnode.com/posts/how-to-declare-javascript-variables-a-look-at-let-const-and-var-5d801c70c377/66bce175bf44a4e8b300aea5"
---

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

Discussion

# [How to declare JavaScript variables: a look at let, const, and var](https://freecodecamp.org/news/how-to-declare-javascript-variables-a-look-at-let-const-and-var-5d801c70c377?utm_source=hashnode&utm_medium=feed)

With the old JavaScript, we had only one way to declare a variable, and that was with var, like var x = 10. It will create a variable called x and assign a value 10 to it. Now with modern ES6 JavaScript, we have 3 different ways to declare a variable...

Mar 11, 2019 · 5 min read · freecodecamp.org  
Read the article

-   [#es6](https://hashnode.com/tag/es6)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#programming](https://hashnode.com/tag/programming)
-   [#tech](https://hashnode.com/tag/tech)
-   [#technology](https://hashnode.com/tag/technology)

## Written by

[Shirshendu Bhowmick](https://hashnode.com/@shirshendu)

@shirshendu · Bangalore, Karnataka, India

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

Senior Software Engineer at Coursera

Senior Software Engineer @Coursera | JavaScript | Golang | React | Ex smallcase Hobbyist Bird Photographer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
