Skip to content

Commit effa6f8

Browse files
committed
let vs var updated!
1 parent 325c936 commit effa6f8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
var print = (prompt) => {
1+
const print = (prompt) => {
22
console.log(prompt);
33
}
44

55
let count = 0;
66

77
function incement(){
8+
// let count = counter;
9+
let name = "Sandeep";
810
count += 1;
911
print(count);
1012
}
1113

12-
print(count);
13-
incement();
14-
print(count);
14+
print(count);
15+
incement();
16+
print(count);
17+
18+
// print = 3; FIXME: Read about TypeError: Assignment to the Constant Variable

0 commit comments

Comments
 (0)