Skip to content

Commit 38f37a7

Browse files
Explain const assignment error
1 parent 1cca64e commit 38f37a7

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • Sprint-2/2-mandatory-errors

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

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

33
const age = 33;
44
age = age + 1;
5+
6+
// Error: TypeError
7+
// Why: age was declared with const, so it cannot be reassigned.

0 commit comments

Comments
 (0)