third.html
Variables
Imagine programmer has a glass of water So we can say glass is variable and water is value or data . As programmer imagine glass store water in the same way Varibles are also contain different different values.
Data Type
Data type are nothing but the type of data that a values contain.
like Int , float , string , boolean , arrays , objects , more...
"NO need to declared data type in JavaScript"
Rules in JavaScript to Declared varibles
1 Variables contains letters , underscores , digits and dollars sings.
2. Variables are start with letter , $ sign and _ underscore only.
3. Variables Name are CaseSensitive.
4. Reserved keywords (class , id , function) cannot used in javascript.
One statement and many variables
var programmar = "Rakesh" , class = "12th" , subject = "Maths";
or
var programmar = "Rakesh",
class ="12th",
subject = "Maths";
overriding in JavaScript
var person = "rohit";
person = "Rakesh";
Difference between var , let , const
var can reassinged values in same block scope or different block of scope , although It can assing values befor declared variables (hoisting is possible).
let can not reassinged values in same block scope but It can assing values in different block of scope.Hoisting is not possible(In let , variable can not assing values before let declaration).
const can not reassinged values in same block of scope but it can assing values in different block of scope. Hoisting is not possible (In let , variable can not assing values before let declaration).
Timestapms
Introduction and use of variable 00.01
Datatype 03.05
Rules to define variable name 05.40
One statement with multiple variables 07.50
Re-declaration of varialbes (Override variables) 09.48
No comments:
Post a Comment