DEV Community

Cover image for Values and Variable in JavaScript?
Ajay Yadav 🎯
Ajay Yadav 🎯

Posted on

Values and Variable in JavaScript?

What is value?

  • A value is a fixed object.

  • Or, a value is a definite item or entity.

  • In the context of programming, A values can be a number, string, double, function, etc

Note: JavaScript function also produces a value!

What is the use of value?

  • Values are used to perform calculations.

  • Suppose, 10 & 20 are values, you can add, and subtract, them using an operator!

How to invoke or call value?

  • You can invoke or call your values with their name, which is a variable.

What is a variable?

  • Variable is "bucket" for storing "water"

Buckets => Memory
Water => Data or value

  • Or, variables are container/memory for storing data values.

  • Or, A value stored in a variable.

  • Or, A variable can be stored in any type of data, for example, number, string, etc.

  • Or, a variable contains a value.

  • Or, a variable is the name of the memory location.

😍That's all for now, thanks for reading this article to the end.

πŸ”” Don't forget to follow me on:


Top comments (0)