Skip to content

Commit 8b1f048

Browse files
committed
Refactor comments in mandatory error examples for clarity and instruction
1 parent 02c8df6 commit 8b1f048

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
This is just an instruction for the first activity - but it is just for human consumption
2-
We don't want the computer to run these 2 lines - how can we solve this problem?
1+
// This is just an instruction for the first activity - but it is just for human consumption
2+
// We don't want the computer to run these 2 lines - how can we solve this problem?
3+
// by simply commenting out the lines with // the computer will ignore these lines and not run them

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

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

3-
const age = 33;
3+
// const age = 33;
4+
// age = age + 1;
5+
6+
// this code will throw an error because age is declared as a constant and we cannot reassign a new value to a constant variable
7+
8+
// To fix this error, we can change the declaration of age from const to let
9+
10+
let age = 33;
411
age = age + 1;
12+
13+
// Now the code will work without throwing an error, and the value of age will be updated to 34.

0 commit comments

Comments
 (0)