From 7ba1aabe8bbab6db396ab366d6111b9d08e75f0d Mon Sep 17 00:00:00 2001 From: Pretty Taruvinga Date: Mon, 9 Feb 2026 16:26:36 +0200 Subject: [PATCH 1/5] added the forward slashes to solve the problem --- Sprint-1/2-mandatory-errors/0.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sprint-1/2-mandatory-errors/0.js b/Sprint-1/2-mandatory-errors/0.js index cf6c5039f..65ad3030d 100644 --- a/Sprint-1/2-mandatory-errors/0.js +++ b/Sprint-1/2-mandatory-errors/0.js @@ -1,2 +1,2 @@ -This is just an instruction for the first activity - but it is just for human consumption -We don't want the computer to run these 2 lines - how can we solve this problem? \ No newline at end of file +//This is just an instruction for the first activity - but it is just for human consumption +//We don't want the computer to run these 2 lines - how can we solve this problem? \ No newline at end of file From 37a866a8ef5675d355af79c27ea0f8ace914657e Mon Sep 17 00:00:00 2001 From: Pretty Taruvinga Date: Mon, 9 Feb 2026 17:04:30 +0200 Subject: [PATCH 2/5] used let instead of const because i am changing the value --- Sprint-1/2-mandatory-errors/1.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-1/2-mandatory-errors/1.js b/Sprint-1/2-mandatory-errors/1.js index 7a43cbea7..031839b47 100644 --- a/Sprint-1/2-mandatory-errors/1.js +++ b/Sprint-1/2-mandatory-errors/1.js @@ -1,4 +1,4 @@ // trying to create an age variable and then reassign the value by 1 -const age = 33; +let age = 33; age = age + 1; From 894dc7a6832fb99eb2ab698d899b91a9ad375339 Mon Sep 17 00:00:00 2001 From: Pretty Taruvinga Date: Mon, 9 Feb 2026 17:16:18 +0200 Subject: [PATCH 3/5] added backticks and moved the variable above the console.log --- Sprint-1/2-mandatory-errors/2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-1/2-mandatory-errors/2.js b/Sprint-1/2-mandatory-errors/2.js index e09b89831..2865eb8a4 100644 --- a/Sprint-1/2-mandatory-errors/2.js +++ b/Sprint-1/2-mandatory-errors/2.js @@ -1,5 +1,5 @@ // Currently trying to print the string "I was born in Bolton" but it isn't working... // what's the error ? -console.log(`I was born in ${cityOfBirth}`); const cityOfBirth = "Bolton"; +console.log(`I was born in ${cityOfBirth}`); From e8ea254e9c9399be712fce08eb01dbd0532c2213 Mon Sep 17 00:00:00 2001 From: Pretty Taruvinga Date: Mon, 9 Feb 2026 17:29:40 +0200 Subject: [PATCH 4/5] i added .tostring() --- Sprint-1/2-mandatory-errors/3.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sprint-1/2-mandatory-errors/3.js b/Sprint-1/2-mandatory-errors/3.js index ec101884d..047e0302c 100644 --- a/Sprint-1/2-mandatory-errors/3.js +++ b/Sprint-1/2-mandatory-errors/3.js @@ -7,3 +7,6 @@ const last4Digits = cardNumber.slice(-4); // Then run the code and see what error it gives. // Consider: Why does it give this error? Is this what I predicted? If not, what's different? // Then try updating the expression last4Digits is assigned to, in order to get the correct value +//answer +const cardNumber = 4533787178994213; +const last4DigitsString = cardNumber.toString().slice(-4); \ No newline at end of file From 9600e134d34e062e2e3102a49d5a471e07f61bcf Mon Sep 17 00:00:00 2001 From: Pretty Taruvinga Date: Mon, 9 Feb 2026 17:35:30 +0200 Subject: [PATCH 5/5] renamed the variable --- Sprint-1/2-mandatory-errors/4.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sprint-1/2-mandatory-errors/4.js b/Sprint-1/2-mandatory-errors/4.js index 21dad8c5d..f0ab94e12 100644 --- a/Sprint-1/2-mandatory-errors/4.js +++ b/Sprint-1/2-mandatory-errors/4.js @@ -1,2 +1,2 @@ -const 12HourClockTime = "20:53"; -const 24hourClockTime = "08:53"; \ No newline at end of file +const twelveHourClockTime = "20:53"; +const twentyFourHourClockTime = "08:53"; \ No newline at end of file