Skip to content

Commit 723da0c

Browse files
committed
Sprint 1 errors: explain 1.js const reassignment error
1 parent c9913f5 commit 723da0c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sprint-1/2-mandatory-errors/answers.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
- Error shown:
1313
- Why it happens:
1414
- MDN link (optional):
15+
- Error shown: `TypeError: Assignment to constant variable.` on line 4.
16+
- Why it happens: The variable `age` was declared with `const`, which prevents reassignment. The statement `age = age + 1` attempts to update the value, causing the error.
17+
- MDN link (optional): https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const
1518

1619
## 2.js
1720
- Error shown:

0 commit comments

Comments
 (0)