There was an error while loading. Please reload this page.
1 parent 1d0edb2 commit 077ee11Copy full SHA for 077ee11
1 file changed
Sprint-2/2-mandatory-errors/1.js
@@ -1,12 +1,12 @@
1
// trying to create an age variable and then reassign the value by 1
2
3
-const age = 33;
4
-age = age + 1;
+// const age = 33;
+// age = age + 1;
5
6
// this gives a TypeError
7
-// age is already a const at the start and calling it again just as age wont work, naming it like "older" would work better:
+// const is used so the value can't be changed. Changing const to let will allow its value to be changed.
8
9
-// const age = 33;
10
-// let older = (age + 1);
11
-// console.log(older)
+let age = 33;
+age = (age + 1);
+console.log(age)
12
0 commit comments