From 0e9835ea252ad6f86b838cde1422159739925246 Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Sun, 15 Feb 2026 12:33:10 +0000 Subject: [PATCH 01/14] Write answer on line 7. --- Sprint-1/1-key-exercises/1-count.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Sprint-1/1-key-exercises/1-count.js b/Sprint-1/1-key-exercises/1-count.js index 117bcb2b6..17b7e70c7 100644 --- a/Sprint-1/1-key-exercises/1-count.js +++ b/Sprint-1/1-key-exercises/1-count.js @@ -4,3 +4,4 @@ count = count + 1; // Line 1 is a variable declaration, creating the count variable with an initial value of 0 // Describe what line 3 is doing, in particular focus on what = is doing +//line 3 is reassigning the variable count to a new value.Taking it current value adding 1 to it and storing the result back into count. \ No newline at end of file From ab16689d6281ea0eb7f2ceabbc6280cf895a752d Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Sun, 15 Feb 2026 13:16:51 +0000 Subject: [PATCH 02/14] Declare new initials variables using method charAt also following concatenation rule --- Sprint-1/1-key-exercises/2-initials.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-1/1-key-exercises/2-initials.js b/Sprint-1/1-key-exercises/2-initials.js index 47561f617..202c67880 100644 --- a/Sprint-1/1-key-exercises/2-initials.js +++ b/Sprint-1/1-key-exercises/2-initials.js @@ -5,7 +5,7 @@ let lastName = "Johnson"; // Declare a variable called initials that stores the first character of each string. // This should produce the string "CKJ", but you must not write the characters C, K, or J in the code of your solution. -let initials = ``; +let initials = firstName.charAt(0) + middleName.charAt(0) + lastName.charAt(0); // https://www.google.com/search?q=get+first+character+of+string+mdn From d2d32a4fc780266cf150de597b600e26d648ce6c Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Sun, 15 Feb 2026 14:33:55 +0000 Subject: [PATCH 03/14] Extract the directory and the extension from the original file path. --- Sprint-1/1-key-exercises/3-paths.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Sprint-1/1-key-exercises/3-paths.js b/Sprint-1/1-key-exercises/3-paths.js index ab90ebb28..3e2b4d020 100644 --- a/Sprint-1/1-key-exercises/3-paths.js +++ b/Sprint-1/1-key-exercises/3-paths.js @@ -17,7 +17,12 @@ console.log(`The base part of ${filePath} is ${base}`); // Create a variable to store the dir part of the filePath variable // Create a variable to store the ext part of the variable -const dir = ; -const ext = ; +const dir = filePath.slice(0,lastSlashIndex); + +const lastDotIndex = filePath.lastIndexOf("."); +const ext = filePath.slice(lastDotIndex); + + + // https://www.google.com/search?q=slice+mdn \ No newline at end of file From 1e4ccf1bc5765b46aa538572bba70ef7774e1758 Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Thu, 19 Feb 2026 08:54:23 +0000 Subject: [PATCH 04/14] Expressed the functions with documentation explanation and include the console.log results in five multiple loggings. --- Sprint-1/1-key-exercises/4-random.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Sprint-1/1-key-exercises/4-random.js b/Sprint-1/1-key-exercises/4-random.js index 292f83aab..d826fb62b 100644 --- a/Sprint-1/1-key-exercises/4-random.js +++ b/Sprint-1/1-key-exercises/4-random.js @@ -7,3 +7,21 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum; // Try breaking down the expression and using documentation to explain what it means // It will help to think about the order in which expressions are evaluated // Try logging the value of num and running the program several times to build an idea of what the program is doing + + + +//Math.random() returns a random number/ decimal number between 0 (inclusive), and 1 (exclusive). + +//Math.random() always returns a number lower than 1. + +// * (maximum - minimum + 1) multiplying by this is to give a range of possible values. + +// adding the minimum at the end is to give a range value between the minimum and maximum inclusive. + +// Math.floor usually rounds the number down to the nearest integer. + +console.log (num); // first print is 24 +console.log (num); // second print 3 +console.log (num); // third print is 17 +console.log (num); // fourth print is 70 +console.log (num); // fifth print is 7 \ No newline at end of file From 4610def2f3c22115649db22a05ae385aca9832fb Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Thu, 19 Feb 2026 11:12:37 +0000 Subject: [PATCH 05/14] Correct identified errors. --- Sprint-1/2-mandatory-errors/0.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Sprint-1/2-mandatory-errors/0.js b/Sprint-1/2-mandatory-errors/0.js index cf6c5039f..961ab39b3 100644 --- a/Sprint-1/2-mandatory-errors/0.js +++ b/Sprint-1/2-mandatory-errors/0.js @@ -1,2 +1,9 @@ -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. + +//SyntaxError: Unexpected identifier 'is' that was the error after i ran node. +// I think javascript is trying run them word for word and found is in an unfamiliar place. +// could also be that its trying to run is as a code which is not correct. + +/* To make this correct we can add a double line(//) before the statement to make it a single line comment, +or we can add a line and asterisk before and after to make it a double line comment */ \ No newline at end of file From 145e443a25ffd0bfbab4a148d49664641060572b Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Thu, 19 Feb 2026 11:30:51 +0000 Subject: [PATCH 06/14] Identify the type error and ensure the type error is fixed. --- Sprint-1/2-mandatory-errors/1.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Sprint-1/2-mandatory-errors/1.js b/Sprint-1/2-mandatory-errors/1.js index 7a43cbea7..b27472891 100644 --- a/Sprint-1/2-mandatory-errors/1.js +++ b/Sprint-1/2-mandatory-errors/1.js @@ -2,3 +2,17 @@ const age = 33; age = age + 1; + +//TypeError: Assignment to constant variable. +// here we already have a variable constant age=33, now we are trying to reassign the variable constant. + +// to enable this work, we can say; +let age = 33; +age = age + 1; + +console.log(age); //34 +//this will be a way to fix error. + + + + From 78969928c3aa92c30eae5052874d1fe734fee650 Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Thu, 19 Feb 2026 11:41:34 +0000 Subject: [PATCH 07/14] Identify reference error and also state the remedy. --- Sprint-1/2-mandatory-errors/2.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sprint-1/2-mandatory-errors/2.js b/Sprint-1/2-mandatory-errors/2.js index e09b89831..e71c7547f 100644 --- a/Sprint-1/2-mandatory-errors/2.js +++ b/Sprint-1/2-mandatory-errors/2.js @@ -3,3 +3,7 @@ console.log(`I was born in ${cityOfBirth}`); const cityOfBirth = "Bolton"; + + +//ReferenceError: Cannot access 'cityOfBirth' before initialization +// you always need to declare a variable before using it. \ No newline at end of file From 82678b6bfe2c756f407a57a2442c7cd00927e085 Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Thu, 19 Feb 2026 11:59:28 +0000 Subject: [PATCH 08/14] Enable change to error identified, and correct the right expression. --- Sprint-1/2-mandatory-errors/3.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Sprint-1/2-mandatory-errors/3.js b/Sprint-1/2-mandatory-errors/3.js index ec101884d..71ab5e8d0 100644 --- a/Sprint-1/2-mandatory-errors/3.js +++ b/Sprint-1/2-mandatory-errors/3.js @@ -1,5 +1,8 @@ const cardNumber = 4533787178994213; -const last4Digits = cardNumber.slice(-4); +const last4Digits = cardNumber.toString().slice(-4); + + +console.log(last4Digits); // "4213" // The last4Digits variable should store the last 4 digits of cardNumber // However, the code isn't working @@ -7,3 +10,9 @@ 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 + + +/* I don't think it will work, because card number is a number, +and .slice() is a string method and we must convert the number to string method to work*/ + +//TypeError: cardNumber.slice is not a function. this was after running node. \ No newline at end of file From 9923e051992d78cf584b4f1f0d36414b1646b60f Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Thu, 19 Feb 2026 12:26:15 +0000 Subject: [PATCH 09/14] Rname constant variable to start with letter instead of number. --- Sprint-1/2-mandatory-errors/4.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Sprint-1/2-mandatory-errors/4.js b/Sprint-1/2-mandatory-errors/4.js index 21dad8c5d..1e85ac63f 100644 --- a/Sprint-1/2-mandatory-errors/4.js +++ b/Sprint-1/2-mandatory-errors/4.js @@ -1,2 +1,11 @@ -const 12HourClockTime = "20:53"; -const 24hourClockTime = "08:53"; \ No newline at end of file +const Hour12ClockTime = "20:53"; +const hour24ClockTime = "08:53"; + +console.log(Hour12ClockTime); //"20;53" +console.log(hour24ClockTime); // "08:53" + +// SyntaxError: Invalid or unexpected token. +// variable names cannot start with number. + +// renaming our variable would be the right thing. + From a7ab41d5282f8837bf57de93c6afec338b7a5574 Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Thu, 19 Feb 2026 13:17:36 +0000 Subject: [PATCH 10/14] Effect changes with the answers given. --- Sprint-1/3-mandatory-interpret/1-percentage-change.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Sprint-1/3-mandatory-interpret/1-percentage-change.js b/Sprint-1/3-mandatory-interpret/1-percentage-change.js index e24ecb8e1..2c44b2b6a 100644 --- a/Sprint-1/3-mandatory-interpret/1-percentage-change.js +++ b/Sprint-1/3-mandatory-interpret/1-percentage-change.js @@ -20,3 +20,14 @@ console.log(`The percentage change is ${percentageChange}`); // d) Identify all the lines that are variable declarations // e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression? + + +// a) 5 function calls. 2 in line 4, 2 in line 5, and 1 in line 10. + +// b) SyntaxError: missing ) after argument list. There is a missing comma after argument. It can be fixed by adding a comma. + +// c) line 4 and 5. + +// d) line 1,2, 7, and 8. + +// e) The expression is used to remove commas from the string and convert it into a number so it can be used in calculations. \ No newline at end of file From 9fd849ac0f452178e7e8d503b3f34021ce080446 Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Thu, 19 Feb 2026 13:54:48 +0000 Subject: [PATCH 11/14] Ensure my answers reflex in this file. --- .../3-mandatory-interpret/2-time-format.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Sprint-1/3-mandatory-interpret/2-time-format.js b/Sprint-1/3-mandatory-interpret/2-time-format.js index 47d239558..777adeb3b 100644 --- a/Sprint-1/3-mandatory-interpret/2-time-format.js +++ b/Sprint-1/3-mandatory-interpret/2-time-format.js @@ -1,4 +1,4 @@ -const movieLength = 8784; // length of movie in seconds +const movieLength = -8784; // length of movie in seconds const remainingSeconds = movieLength % 60; const totalMinutes = (movieLength - remainingSeconds) / 60; @@ -23,3 +23,20 @@ console.log(result); // e) What do you think the variable result represents? Can you think of a better name for this variable? // f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer + + + +// a) 6 variables declarations. + +// b) 1 function call. + +/* c) The remainder (%) operator returns the remainder left over when one operand is divided by a second operand. It always takes the sign of the dividend. +In this case it will give the remainder of 8748 % 60 */ + +// d) It simply wants to get the length of the movie in minutes. subtract the remaining seconds from the movie length and convert to minutes. + +// e) It represents the movie durations in hours, minutes and seconds. (movie duration). + +/*f) I have tried three values and it worked. It will work perfectly for larger and smaller numbers. +However, with negative values it gives negative figures.*/ + From 8073d0bc990b12ca7730cebc6b5b606cd9a24b8c Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Thu, 19 Feb 2026 14:22:22 +0000 Subject: [PATCH 12/14] Validate the descriptions introduced. --- Sprint-1/3-mandatory-interpret/3-to-pounds.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Sprint-1/3-mandatory-interpret/3-to-pounds.js b/Sprint-1/3-mandatory-interpret/3-to-pounds.js index 60c9ace69..3327d27cf 100644 --- a/Sprint-1/3-mandatory-interpret/3-to-pounds.js +++ b/Sprint-1/3-mandatory-interpret/3-to-pounds.js @@ -25,3 +25,13 @@ console.log(`£${pounds}.${pence}`); // To begin, we can start with // 1. const penceString = "399p": initialises a string variable with the value "399p" + +// 2.line 3-6 function is trying to remove the p and make the strings numeric only. + +// 3.line 8 ensure there are three characters and can split equally to pounds and pence. + +// 4.line 9-12 this is extracting pounds from the number. + +// 5.line 14-16 ensure the pence always have 2 digits. + +// line 18 gives the value in pounds and pence. From 271aa397555a18168d969b960a045512e6d0c4e1 Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Sat, 21 Feb 2026 02:46:18 +0000 Subject: [PATCH 13/14] Effect the answers given to the question --- Sprint-1/4-stretch-explore/chrome.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sprint-1/4-stretch-explore/chrome.md b/Sprint-1/4-stretch-explore/chrome.md index e7dd5feaf..98fd95b45 100644 --- a/Sprint-1/4-stretch-explore/chrome.md +++ b/Sprint-1/4-stretch-explore/chrome.md @@ -16,3 +16,9 @@ Now try invoking the function `prompt` with a string input of `"What is your nam What effect does calling the `prompt` function have? What is the return value of `prompt`? + + +line 13- when i ran the function on console tab, it showed a new word hello world in the next line. + +line 17&18 - when i ran the 'prompt' function it pop up a box for imputing my name and it returned undefined. +after i wrote myname in the next line it brought out my name. \ No newline at end of file From 851cc57abada081fd34b29dfc49028b78a38924c Mon Sep 17 00:00:00 2001 From: tasleemadedokun Date: Sat, 21 Feb 2026 03:11:14 +0000 Subject: [PATCH 14/14] Implement answers --- Sprint-1/4-stretch-explore/objects.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Sprint-1/4-stretch-explore/objects.md b/Sprint-1/4-stretch-explore/objects.md index 0216dee56..e38d3de84 100644 --- a/Sprint-1/4-stretch-explore/objects.md +++ b/Sprint-1/4-stretch-explore/objects.md @@ -14,3 +14,17 @@ Answer the following questions: What does `console` store? What does the syntax `console.log` or `console.assert` mean? In particular, what does the `.` mean? + +line 7 =ƒ log() { [native code] } + +line 9 = console {debug: ƒ, error: ƒ, info: ƒ, log: ƒ, warn: ƒ, …} + +line 11 = 'object' + + +line 15 =console is like an object that helps to store methods used for debugging and printing output in the browser’s developer tools. + + + line 16 = 'console.log'means access or get the log function fom the object console. + 'console.assert' means access or get the assert function from the object console. + while the '.' is an access operator that access methods or properties from and object.