Skip to content

Commit d41194c

Browse files
changed age variable declaration from const to let for reassignment
1 parent ceb590d commit d41194c

File tree

1 file changed

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

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
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+
//this error was solved by using the let keyword to declare the age variable, allowing it to be reassigned later instead of using const, which would have caused an error if we tried to reassign it.

0 commit comments

Comments
 (0)