Skip to content

Commit 73b8e26

Browse files
fix the error
1 parent ccb29be commit 73b8e26

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
We don't want the computer to run these 2 lines - how can we solve this problem???*/
66

77
// we can put "//" in the beginning of the line so computer ignore them
8-
// or put them between /* and */
8+
// or put them between /* and */

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
let age = 33;
44
age = age + 1;
55
console.log(`${age}`);
6-
//We should use let if we want to change the value.
6+
//We should use let if we want to change the value.
7+
//Before I changed const to let node show this error message: (Assignment to constant variable.)

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@
33
const cityOfBirth = "Bolton";
44
console.log(`I was born in ${cityOfBirth}`);
55
// This error (Cannot access 'cityOfBirth' before initialization) is because we need to declare the variable before using it.
6-

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
const cardNumber = 4533787178994213;
22
const last4Digits = String(cardNumber).slice(-4);
33
console.log(`${last4Digits}`);
4-
// we get error (cardNumber.slice is not a function) because slice is a String method
4+
// we get error (cardNumber.slice is not a function) because slice is a String method

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
const HourClockTime12 = "8:53pm";
22
const hourClockTime24 = "20:53";
3-
//JavaScript variable names cannot start with a number.
3+
//JavaScript variable names cannot start with a number.

0 commit comments

Comments
 (0)