Skip to content

Commit 920f815

Browse files
committed
The explanations for the errors
1 parent afc2430 commit 920f815

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22

33
let age = 33;
44
age = age + 1;
5+
6+
// The value of 'let' variable can be reassigned not the value of 'const';

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33

44
const cityOfBirth = "Bolton";
55
console.log(`I was born in ${cityOfBirth}`);
6+
7+
// The first first needs to be initialised then it will be accessed;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
const cardNumber = 4533787178994213;
22
// const last4Digits = cardNumber.slice(-4);
33

4+
// slice() method cannot work on numbers.
5+
// I changed the numbers to string and then implemented the slice() method
46
const last4Digits = cardNumber.toString().slice(-4);
57

68
// The last4Digits variable should store the last 4 digits of cardNumber

0 commit comments

Comments
 (0)