What is JavaScript?
JavaScript is a high-level,dynamic and interpreted programming language used to make websites interactive.
we can use it to control anything like data validation, button functionality,animation updates and more.
What is Data type?
Every value in JavaScript has a specific type.
This type determines what operations can be performed on the value and how it is stored.
How many Data types?
There are 8 basic data types in JavaScript
String
Number
Bigint
Boolean
Undefined
Null
Symbol
Object
JavaScript Variables
In a programming language, variables are used to store data values.
JavaScript uses the keywords var,let and const to declare variables.
Types of Scopes :
- Golbal Scope(any one can access)
- Local Scope(only used in a particular area)
Different between Var,let and Const
Var:
var keyword is not used because in function method.It acts a local variable.But in if it acts as a global variable.It also Redeclared again and again it affect the readability .
Let:
We can't redeclare but we can reinitialize
Const:
Const means Constant.we can't redeclare or reinitialize.
Top comments (0)