1-what is variables in java script??
variables are used to store data
In js variable is used to store some data
var x = 20;
var chr = “string”;
Using var
Using let
Using const
They are 3 types of variables in js
Let , const and var
variable is container which stores some value or variable is the name of the memory location which stores contain value there are 3 types key words to declare the variable let var const
its used to store data
2-What are data types in JS??
variables are used to store the data for future reference or reusability
data type is a type of data that we want to store in variable like int,float,boolean
primitive and non primitive
Variable is a one kind of storage to store a data in JavaScript. There are three ways to store variables, they are let, const, var.
primitive and non primitive
these are main two data types in js
Number
String
Boolean
Null
Object
- String.
- Number.
- Boolean.
- Undefined.
- Null.
- Object.
there are two types of datatypes 1)primitive 2)non-primitive
in primitive we have the number,string , boolean, symbol, bigint
in non primitive we have the 1)array 2)objects 3)functions
primitive and Non- primitive datatypes