Skip to main content
D
JavaScript
JavaScript Variables

JavaScript Variables

JavaScript variables store data values for later use.

Read Time
5 min read
Difficulty
Beginner
Last Updated
Jun 15, 2026
Version
v1.0.0

Introduction

JavaScript uses variables as named containers to hold data. Developers declare these variables using specific keywords before assigning them a value. Modern JavaScript strongly encourages using `let` and `const` instead of the older `var` keyword.

Example

Example
1/* this creates variables */
2let score = 100;
3const playerName = "John";
4let isWinner = true;

Key Points

  • Variables store reusable data.
  • The `let` keyword creates changeable variables.
  • The `const` keyword creates unchangeable variables.
  • The `var` keyword is an older way to declare variables.

Up Next

Continue your journey with the next topic.

Go to JS Let