Skip to content

Commit 9a8d497

Browse files
committed
updated file with error type and explanation
1 parent 2de6944 commit 9a8d497

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
@@ -4,3 +4,6 @@ let age = 33;
44
age = age + 1;
55

66
console.log(age);
7+
8+
// TypeError: Assignment to constant variable.
9+
//This means javascript cannot reassign const variables. Let must be used in order for the variable to be reassigned so it can change. I have now declared the variable using the let keyword and it now prints (34) in the console.

0 commit comments

Comments
 (0)