Skip to content

Commit 2694eea

Browse files
Mandatory exercises solved
1 parent 1fc990a commit 2694eea

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Currently trying to print the string "I was born in Bolton" but it isn't working...
22
// what's the error ?
33

4-
console.log(`I was born in ${cityOfBirth}`);
4+
55
const cityOfBirth = "Bolton";
6+
console.log(`I was born in ${cityOfBirth}`);

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
const cardNumber = 4533787178994213;
2-
const last4Digits = cardNumber.slice(-4);
2+
const last4Digits = cardNumber.toString().slice(-4);
3+
4+
console.log(last4Digits);
5+
6+
// This code will not work as written because cardNumber is a number, and numbers do not have a .slice() method.
37

48
// The last4Digits variable should store the last 4 digits of cardNumber
59
// However, the code isn't working

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
const 12HourClockTime = "8:53pm";
2-
const 24hourClockTime = "20:53";
1+
const _12HourClockTime = "8:53pm";
2+
const _24hourClockTime = "20:53";

0 commit comments

Comments
 (0)