Javascript variables

In JavaScript, a variable holdes the value or data that can be used later-on, changed or manupulated.

Example of variables:

let personId = 1;
let taxPercentage = 1.0;
let personName = 'string value';
let stringArray = ['hello', 'world'];
let keyValuePair = {'color': 'black'};

Variables are the heart and brain of the javascipt code. without variable its not possible to even perform any logical operation.

You may have top level variable holding your all data. you need to devide it in to little variables to access them efficiently aswell to perform logical operation on it.

You can check our detailed articale how to create, access and manupulate variables.

Popular Javascript variables articles and code snippets

Related Articles

js interview questions