Variables in JavaScript - In this JavaScript tutorial for beginners, I will explain what a variable is and how we can declare variables using the var, let, and const keywords.
In a programming language, a variable is a way to store information in the programs we write. At a slightly more advanced level, a variable is a location in the computer's memory that we can access based on the name we give to that variable.
A variable in JavaScript can be declared using one of the var, let, or const keywords.
What is the difference between var, let, and const?
var = we declare global variables that can be accessed from anywhere in the program
let = we declare variables that can only be accessed for the purpose for which they were created
const = we declare variables (constants) that can only be accessed for the purpose for which they were created and for which we cannot change the value after initialization
📺 Recommended videos
=========================================
👉 JavaScript course for BEGINNERS: • Curs JavaScript in limba ROMANA pentru INC...
👉 HTML and CSS course in ROMANIAN for BEGINNERS: • Curs HTML si CSS in limba ROMANA pentru IN...
👉 VS Code course: • Visual Studio Code
=====================================================
🕗 Table of Contents
======================================
00:00 - What is a variable
02:08 - Working with variables in JavaScript
06:35 - Naming rules
08:30 - The difference between var, let and const
=