Skip to content

Commit 077ee11

Browse files
committed
corrected error for 2-mandatory-errors.1js
1 parent 1d0edb2 commit 077ee11

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

  • Sprint-2/2-mandatory-errors

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// trying to create an age variable and then reassign the value by 1
22

3-
const age = 33;
4-
age = age + 1;
3+
// const age = 33;
4+
// age = age + 1;
55

66
// 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:
7+
// const is used so the value can't be changed. Changing const to let will allow its value to be changed.
88

9-
// const age = 33;
10-
// let older = (age + 1);
11-
// console.log(older)
9+
let age = 33;
10+
age = (age + 1);
11+
console.log(age)
1212

0 commit comments

Comments
 (0)