-
Notifications
You must be signed in to change notification settings - Fork 0
/
variable-let-const.js
44 lines (33 loc) · 1.35 KB
/
variable-let-const.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// var a = "Hello World";
// var a=30; //over write a value
// console.log(a);
//define variable
//var firstName = "Helloo world";
//var 88firstName = "Helloo world"; // this is worng way
//var first-name = "Helloo world"; // this is worng way
// var first_name = "Helloo world";
// var firstname = "Helloo world";
// var a , b; //this is undinfe
// a = 10;
// b=20;
// console.log(a);
// console.log(b);
//LET
// let firstname = "Helloo world";
// firstname = "Helloo world 90"; //let not deifne same variable and dinfne single time variable and use multiple time defrant value
// console.log(firstname);
//CONST
// const firstname = "Helloo world";
// //firstname = "Helloo world 90"; //const not deifne same variable and not a single time dinfine and use only single time
// console.log(firstname);
// //Defrant Var, Const, Let
// // Var:- var define multiple time override a value it working and print a letest value
// // exm: var a="helloo";
// // var a="Hii";
// // a="123";
// // Let: Let deifne a single time variable if you define a same varible multiple time that is thow a error but varible value do over ride
// // exm: let a="helo";
// // a="123";
// Const: Const define a sinle vaible and value and not allowed override value and same variable not define
// exm: const a="helloo";
// a="hiii"; //thow error so run only signle query