DEV Community

Cover image for Variables and Datatypes In JavaScript-series-1a
Santhi Sri Jamisetty
Santhi Sri Jamisetty

Posted on • Edited on

1 1

Variables and Datatypes In JavaScript-series-1a

Photo by Maureen Sgro on Unsplash

What are variables? Why do we need them in programming.

Variables are containers (a memory location)as seen above in the color palette to store values and access them whenever required.

So what type of values our variables store?

Any value or any piece of information our containers can store. As in the color-palette which can store any color and remove the color, similarly, in variables we can rewrite the values as per the requirement.

Again the information stored in variable can be of same type, called "Primitive type" as in example 1 which stored a string.We'll get it to later when we learn about the data types.
Or the other type includes collections called "Objects" which hold different types together. Like when you work with excel file or database table the entire record or row is a collection which constitute numbers, null values, string etc. as in example 2

var myName = "Santhi"; ------example 1-Primitive type

First Name Last Name Registration Cost
Sean Forbes $1600
Jack Rogers $985
Andy Young
          ...To be continued in series 1b.
Enter fullscreen mode Exit fullscreen mode

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up