Skip to content

Commit 89ba018

Browse files
authored
Merge pull request Swap76#236 from ferdiaz93/master
Issue Swap76#197
2 parents 1ca6109 + 7359553 commit 89ba018

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

JavaScript_Basics/variables.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
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.
79
userNickname = "Swap76";
10+
console.log(userNickname) // Output {"Swap76"}
811

912
const 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:

0 commit comments

Comments
 (0)