Skip to content

Commit ea56b8e

Browse files
committed
Explain error and how to fix
1 parent eee3689 commit ea56b8e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • Sprint-2/2-mandatory-errors

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

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

33
const age = 33;
44
age = age + 1;
5+
6+
//TypeError: Assignment to constant variable.
7+
//Age is constant so can't be reassigned
8+
//To fix, change const to let, so line 3 becomes:
9+
//let age = 33;

0 commit comments

Comments
 (0)