Skip to content

Commit 27662d6

Browse files
authored
writing coding and answering some quiestions
1 parent f3afc49 commit 27662d6

File tree

5 files changed

+5
-1
lines changed

5 files changed

+5
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
12
//This is just an instruction for the first activity - but it is just for human consumption
23
//We don't want the computer to run these 2 lines - how can we solve this problem?

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

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

3+
34
let age = 33;
45
age = age + 1;
56
console.log(age)

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

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

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

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const last4Digits = cardNumber.slice(-4);
88
// Consider: Why does it give this error? Is this what I predicted? If not, what's different?
99
// Then try updating the expression last4Digits is assigned to, in order to get the correct value
1010

11+
1112
//Answer
1213

1314
// This code is not working because slice() is working with "string" or "arrays" but not with numbers. and cardNumber is a number.
@@ -17,3 +18,4 @@ const last4Digits = cardNumber.slice(-4);
1718
const cardNumber = 4533787178994213;
1819
const last4Digits = String(cardNumber).slice(-4);
1920
console.log(last4Digits)
21+

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const 12HourClockTime = "20:53";
2+
23
const 24hourClockTime = "08:53";
34
// the 12 and 24 are changing position
45
const 24HourClockTime = "20:53";

0 commit comments

Comments
 (0)