Skip to content

Commit 5f6d870

Browse files
committed
Allow reassignment of age variable
1 parent 783db28 commit 5f6d870

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • Sprint-1/2-mandatory-errors

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ age = age + 1;
55

66
//The error message displayed by Node.js is:
77
//Uncaught TypeError: Assignment to constant variable
8-
//The error happens because const creates a variable whose value cannot be reassigned.
8+
//The error happens because const creates a variable whose value cannot be reassigned.
9+
//To allow the value to change, the variable should be declared with let instead of const.

0 commit comments

Comments
 (0)