JavaScripts Variables

Ryan Locascio
1 min readJan 15, 2022

JavaScript is a great programming language for beginners. When learning something new, it is always good to start with the basics. Learning the three different variables is a great place to start.

The first variable var that we will go over was used in javaScript versions from 1995–2015 (If you want your code to run in older browser, you must use var). The variable assignment var allows you to reassign a variable:

Which brings us to our next variable assignment, let. Just like var, when using let you can redeclare the variable. This variable assignment can be used for newer web browsers(any browser version after 2015).

The only variable assignment that you can not reassign the value of the declared variable is, const. Once you assign a variable using const, it cannot be redeclared.

Variable assignments may not seem too important at first, but they are tools that will help in your web development journey. The way I remember what each assignment means is like this:

var = “variable has var in the word, variables can be changed.”

let = “Let it change.”

const = “constant, can not change.”

Happy Coding!!!!

--

--