You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9a8d497
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: Sprint-2/2-mandatory-errors/1.js
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4,3 +4,6 @@ let age = 33;
4
4
age=age+1;
5
5
6
6
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