Skip to content

Commit c557dca

Browse files
committed
const to let
let allows variable age, const does not.
1 parent 9c2b2fc commit c557dca

File tree

1 file changed

+5
-1
lines changed
  • Sprint-1/2-mandatory-errors

1 file changed

+5
-1
lines changed

Sprint-1/2-mandatory-errors/1.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
// trying to create an age variable and then reassign the value by 1
22

3-
const age = 33;
3+
let age = 33;
44
age = age + 1;
5+
console.log(age);
6+
7+
// The code above will output 34, because we are reassigning the value of age to be the current value of age plus 1. So, 33 + 1 = 34.
8+

0 commit comments

Comments
 (0)