File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 22
33// There is only 3 types of variables in javascript
44
5- let userNickname = "Swapnil" ; // New type introduced in ES6. Value of let can change any time.
5+ var day26 = 26 ; // This is Deprecated as this creates many problems in future.
6+ //Variables created with var can be rewrite but the most important problem is about the scope.
67
8+ let userNickname = "Swapnil" ; // New type introduced in ES6. Value of let can change any time.
79userNickname = "Swap76" ;
10+ console . log ( userNickname ) // Output {"Swap76"}
811
912const PI = 3.14 ; // New type introduced in ES6. Value of pi now cannot be changed as this is defined as const.
10-
11- var day26 = 26 ; // This is Deprecated as this creates many problems in future.
12-
13+ PI = 2 ; // Output {Error: PI is read only}
14+ console . log ( PI ) // Output {3.14}
1315
1416
1517//Tips: *use significatives variables names, example:
You can’t perform that action at this time.
0 commit comments