Skip to content

Commit 4ce90b9

Browse files
committed
fix: change const to let for age variable to allow reassignment
1 parent 6c59bf1 commit 4ce90b9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Sprint-1/errors/1.js

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

3-
const age = 33;
4-
age = age + 1;
3+
let age = 33;
4+
age += 1;
5+
console.log(age);
6+
7+
// We need to use 'let' to reassign a variable; 'const' does not allow reassignment.

0 commit comments

Comments
 (0)