Skip to content

Commit 5b0c0bc

Browse files
committed
Interpret error message when a const variable is reassigned
1 parent bbcddb9 commit 5b0c0bc

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+
7+
// The error message is "Assignment to constant variable", which means that a variable declared with the 'const' keyword
8+
// cannot be reassigned to a new value after its initial declaration.

0 commit comments

Comments
 (0)