Skip to content

Commit ac2cdb5

Browse files
committed
fixed error by changing const to let for age reasignment.
1 parent a9f60fe commit ac2cdb5

File tree

1 file changed

+4
-0
lines changed
  • Sprint-1/2-mandatory-errors

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22

33
const age = 33;
44
age = age + 1;
5+
6+
// Error: The variable const for the "age" value can not be reassigned
7+
// const means "constant" once assigned, it can not be changed.
8+
// to fix this error, we use "let" instead of "const" to declare the age variable.

0 commit comments

Comments
 (0)