🌐
W3Schools
w3schools.com › js › js_variables.asp
JavaScript Variables
Variables are identified with unique names called identifiers. Names can be short like x, y, z. Names can be descriptive age, sum, carName. The rules for constructing names (identifiers) are: Names can contain letters, digits, underscores, and dollar signs. Names must begin with a letter, a $ sign or an underscore (_). Names are case sensitive (X is different from x). Reserved words (JavaScript keywords) cannot be used as names.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Learn_web_development › Core › Scripting › Variables
Storing the information you need — Variables - Learn web development | MDN
If you are using a desktop browser, ... more information on how to access this tool). A variable is a container for a value, like a number we might use in a sum, or a string that we might use as part of a sentence....
Discussions

How do JavaScript’s global variables really work?
TLDR; Everyone lied to you when they said let and const don't create global variables. They absolutely do .. it's just that they don't create window. global variables. More on reddit.com
🌐 r/javascript
47
136
July 7, 2019
Question: Most efficient way to use variables to avoid GC?
The number one thing I've seen writing performant JavaScript code has been making sure that things stay as unboxed primitives (ints, double, etc). Preferably in large typed arrays. Chances are your function itself isn't that hot, I bet the loop is though. Declare primitives once at the top of the function an they'll get allocated on the stack and incur zero GC. (Unless you do something like myInt["someProp"] = "something", in which case it's boxed and slow) More on reddit.com
🌐 r/javascript
20
28
August 18, 2015
[MV] Javascript + Variables and Switches
http://forums.rpgmakerweb.com/index.php?/topic/46456-rpg-maker-mv-script-call-list/ More on reddit.com
🌐 r/RPGMaker
1
1
December 26, 2015
What's the equivalent of java instance variables, in javascript?
Stick with the class. You're going to be more comfortable there and don't worry about anyone saying you shouldn't use OOP. class Rectangle { constructor (x, y, width, height) { this.x = x; // instance variables this.y = y; this.width = width; this.height = height; this.whatever = true; } get area () { // instance property return this.width * this.height; } rotate () { // instance method [this.width, this.height] = [this.height, this.width]; } static fromElement(element) { // class method const bounds = element.getBoundingClientRect(); return new Rectangle(bounds.left, bounds.top, bounds.width, bounds.height); } } const rect = new Rectangle(0,0,200,300); console.log(rect.width); // 200 console.log(rect.area); // 60000 rect.rotate(); console.log(rect.width); // 300 const rect2 = Rectangle.fromElement(document.getElementById('foo')); In the larger scheme of things, the class syntax is still pretty new, so you won't see it being used everywhere, but it should be considered the preferred syntax moving forward for class/constructor definitions in JavaScript. Generally speaking, if you see references to prototype you're looking at legacy code from before class was available. More on reddit.com
🌐 r/javascript
11
5
June 7, 2018
🌐
JavaScript.info
javascript.info › tutorial › the javascript language › javascript fundamentals
Variables
Most of the time, a JavaScript application needs to work with information. Here are two examples: An online shop – the information might include goods being sold and a shopping cart. A chat application – the information might include users, messages, and much more. Variables are used to store this information.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-variables
JavaScript Variables - GeeksforGeeks
Variables in JavaScript can be declared using var, let, or const.
Published   September 27, 2025
🌐
Mozilla
developer.mozilla.org › en-US › docs › Web › JavaScript › Guide › Grammar_and_types
Grammar and types - JavaScript | MDN
This chapter discusses JavaScript's basic grammar, variable declarations, data types and literals.
🌐
javascript.com
javascript.com › learn › variables
Learn to use JavaScript variables with this free resource
JavaScript variables are named values and can store any type of JavaScript value. Learn about JavaScript variable types, what a variable is, variable naming, how to declare a variable, and how to insert variables into strings.
🌐
BrainStation®
brainstation.io › learn › javascript › variables
JavaScript Variables (2025 Tutorial & Examples) | BrainStation®
February 4, 2025 - JavaScript variables are a way of storing information or data in memory and giving it a name to easily remember where the information or data is stored.
Find elsewhere
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Statements › var
var - JavaScript | MDN
The name of the variable to declare. Each must be a legal JavaScript identifier or a destructuring binding pattern.
🌐
Programiz
programiz.com › javascript › variables-constants
JavaScript Variables and Constants
A JavaScript variable is a container for storing data, while a constant is a variable whose value cannot be changed. In this tutorial, you will learn about JavaScript variables and constants with the help of examples.
🌐
TutorialsPoint
tutorialspoint.com › javascript › javascript_variables.htm
JavaScript - Variables
JavaScript variables are used to store data that can be changed later on. These variables can be thought of as named containers. You can place data into these containers and then refer to the data simply by naming the container.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › variables-datatypes-javascript
Variables and Datatypes in JavaScript - GeeksforGeeks
A variable is like a container that holds data that can be reused or updated later in the program. In JavaScript, variables are declared using the keywords var, let, or const.
Published   3 weeks ago
🌐
Codecademy
codecademy.com › docs › javascript › variables
JavaScript | Variables | Codecademy
October 5, 2024 - var is used in pre-ES6 versions of JavaScript. It is function scoped. let is the preferred way to declare a variable when it can be reassigned.
🌐
W3Schools
w3schools.com › js › js_datatypes.asp
JavaScript Data Types
Any variable can be emptied, by setting the value to undefined. The type will also be undefined. car = undefined; // Value is undefined, type is undefined Try it Yourself » · An empty value has nothing to do with undefined. An empty string has both a legal value and a type. let car = ""; // The value is "", the typeof is "string" Try it Yourself » · In JavaScript, a variable or an expression can obtain the datatype null in several ways.
🌐
Code Institute
codeinstitute.net › blog › javascript › javascript variables
Javascript Variables : A Guide - Code Institute Global
April 24, 2023 - Anything that can change is considered to be a variable. JavaScript Variables saves data that can be modified later.
🌐
Mozilla
developer.mozilla.org › en-US › docs › Web › JavaScript › Guide › Data_structures
JavaScript data types and data structures - JavaScript | MDN
JavaScript is a dynamic language with dynamic types. Variables in JavaScript are not directly associated with any particular value type, and any variable can be assigned (and re-assigned) values of all types:
🌐
Scaler
scaler.com › topics › javascript › javascript-variables
JavaScript Variables - Scaler Topics
April 9, 2024 - JavaScript variables, often referred to as 'what is variable in javascript', acts as containers that store values that your code can use later. They can hold many types of data, such as numbers, texts, or more complex objects.
🌐
DEV Community
dev.to › codenutt › everything-you-should-know-about-javascript-variables-p4f
Everything You Should Know About Javascript Variables - DEV Community
November 18, 2019 - Variables don't have types, but the values in them do. These types define intrinsic behavior of the values. - Kyle Simpson ... Note: All of these types except object are called "primitives". In JavaScript, a primitive (primitive value, primitive data type) is data that is not an object and has no methods.
🌐
freeCodeCamp
freecodecamp.org › news › javascript-variables-beginners-guide
JavaScript Variables – A Beginner's Guide to var, const, and let
November 30, 2020 - By Madison Kanna Variables are a fundamental concept in any programming language. In JavaScript, you can declare variables by using the keywords var, const, or let. In this article, you’ll learn why we use variables, how to use them, and the differen...
🌐
Medium
medium.com › @rabailzaheer › understanding-javascript-variables-and-values-e20774e09419
Understanding JavaScript Variables and Values | by Rabail Zaheer | Medium
August 31, 2023 - In the world of programming, variables are like labelled containers that hold information. They help us store data, like numbers, text, or any other value, and use that data throughout our code. JavaScript provides us with three main keywords to…