Account
Categories

variable


Definition:

It is a named location in computer memory that can store values while the program runs.

It stores a value in a variable; you can change it using the program.

It keeps a name and a value.

It helps the programmer use and manage data very easily.

In JavaScript, you can create a variable using var, let, or const.

Variable Name              Value
name
---------->
10
Var/let/const

Types of variables in JavaScript are:

  • var
  • let
  • const