From dc592e4579e9aa181823e0f30e7ac9e6a1be1be9 Mon Sep 17 00:00:00 2001 From: Sayeed Hussain Date: Wed, 17 Jun 2026 12:21:33 +0100 Subject: [PATCH 01/14] Explained what line 3 is doing --- Sprint-1/1-key-exercises/1-count.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sprint-1/1-key-exercises/1-count.js b/Sprint-1/1-key-exercises/1-count.js index 117bcb2b6e..95ada8c65d 100644 --- a/Sprint-1/1-key-exercises/1-count.js +++ b/Sprint-1/1-key-exercises/1-count.js @@ -4,3 +4,5 @@ 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 increases the number by one and reassigns the new value to count, which stored 0 . From 8e4be200ece3378edbc6ca9ee53143bb6f5345c4 Mon Sep 17 00:00:00 2001 From: Sayeed Hussain Date: Wed, 17 Jun 2026 13:08:12 +0100 Subject: [PATCH 02/14] stored initial character of each name --- Sprint-1/1-key-exercises/2-initials.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sprint-1/1-key-exercises/2-initials.js b/Sprint-1/1-key-exercises/2-initials.js index 47561f6175..278e0b25d5 100644 --- a/Sprint-1/1-key-exercises/2-initials.js +++ b/Sprint-1/1-key-exercises/2-initials.js @@ -7,5 +7,8 @@ let lastName = "Johnson"; let initials = ``; -// https://www.google.com/search?q=get+first+character+of+string+mdn +let initials = `${firstName.charAt(0)} ${middleName.charAt(0)} ${lastName.charAt(0)}`; + +console.log(initials); +// https://www.google.com/search?q=get+first+character+of+string+mdn From 5410ef4186e79e9df4f7ad4d3a97755dec4a31a6 Mon Sep 17 00:00:00 2001 From: Sayeed Hussain Date: Thu, 18 Jun 2026 10:37:25 +0100 Subject: [PATCH 03/14] Created dir path and ext variable from filepPath --- Sprint-1/1-key-exercises/3-paths.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Sprint-1/1-key-exercises/3-paths.js b/Sprint-1/1-key-exercises/3-paths.js index ab90ebb28e..aa9cc25ff4 100644 --- a/Sprint-1/1-key-exercises/3-paths.js +++ b/Sprint-1/1-key-exercises/3-paths.js @@ -12,12 +12,15 @@ const filePath = "/Users/mitch/cyf/Module-JS1/week-1/interpret/file.txt"; const lastSlashIndex = filePath.lastIndexOf("/"); const base = filePath.slice(lastSlashIndex + 1); -console.log(`The base part of ${filePath} is ${base}`); +// 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 + 1); +const ext = filePath.slice(filePath.lastIndexOf(".")); -// https://www.google.com/search?q=slice+mdn \ No newline at end of file +// console.log(ext); + +// https://www.google.com/search?q=slice+mdn +// console.log(dir); From c4d5c881a12db1f1afe65fa47325dbef0053cfec Mon Sep 17 00:00:00 2001 From: Sayeed Hussain Date: Thu, 18 Jun 2026 11:44:02 +0100 Subject: [PATCH 04/14] Explained order of operation about math --- Sprint-1/1-key-exercises/4-random.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sprint-1/1-key-exercises/4-random.js b/Sprint-1/1-key-exercises/4-random.js index 292f83aabb..141db25433 100644 --- a/Sprint-1/1-key-exercises/4-random.js +++ b/Sprint-1/1-key-exercises/4-random.js @@ -7,3 +7,11 @@ 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 + +// console.log(num); + +// 1) Num represent a randomly generated whole number between maximum and minimum // + +// 2) Firstly, Math.random create a random number between 0 to 1 then using a maximum and minimum,which gives us range. +// Multiplying them create a random number inside that range. Math.floor remove decimal parts and give us whole number +// finally we add minimum number ( + minimum),which start from a minimum value. Therefore num represent a whole number. From 5c345ec3849345693d18d00da57a3fc8c3007d20 Mon Sep 17 00:00:00 2001 From: Sayeed Hussain Date: Thu, 18 Jun 2026 12:09:32 +0100 Subject: [PATCH 05/14] Explained problem --- Sprint-1/2-mandatory-errors/0.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sprint-1/2-mandatory-errors/0.js b/Sprint-1/2-mandatory-errors/0.js index cf6c5039f7..cc9e5d1180 100644 --- a/Sprint-1/2-mandatory-errors/0.js +++ b/Sprint-1/2-mandatory-errors/0.js @@ -1,2 +1,4 @@ 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 +We don't want the computer to run these 2 lines - how can we solve this problem? + +// We comment them using slash(//) where human can read and computer can't read because it is not a code or translated into code// \ No newline at end of file From 628bf03048dcb3c1dc6ad12a3a6e60a6abec0678 Mon Sep 17 00:00:00 2001 From: Sayeed Hussain Date: Thu, 18 Jun 2026 15:52:17 +0100 Subject: [PATCH 06/14] fix error by changing const to let so the value can be reassigned --- Sprint-1/2-mandatory-errors/1.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sprint-1/2-mandatory-errors/1.js b/Sprint-1/2-mandatory-errors/1.js index 7a43cbea76..97f69fcd5e 100644 --- a/Sprint-1/2-mandatory-errors/1.js +++ b/Sprint-1/2-mandatory-errors/1.js @@ -1,4 +1,5 @@ // trying to create an age variable and then reassign the value by 1 -const age = 33; +let age = 33; age = age + 1; +// console.log(age); From 07c3a74902911220fbe182f249458dcbb2855b18 Mon Sep 17 00:00:00 2001 From: Sayeed Hussain Date: Thu, 18 Jun 2026 16:07:09 +0100 Subject: [PATCH 07/14] fix excution order issue --- Sprint-1/2-mandatory-errors/2.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sprint-1/2-mandatory-errors/2.js b/Sprint-1/2-mandatory-errors/2.js index e09b89831d..1b21eba76e 100644 --- a/Sprint-1/2-mandatory-errors/2.js +++ b/Sprint-1/2-mandatory-errors/2.js @@ -1,5 +1,6 @@ // 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 1cca8c83a25ca5fce32875108ad0f0e5004f6d1e Mon Sep 17 00:00:00 2001 From: Sayeed Hussain Date: Thu, 18 Jun 2026 17:03:07 +0100 Subject: [PATCH 08/14] fix slice error by converting number to string --- Sprint-1/2-mandatory-errors/3.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Sprint-1/2-mandatory-errors/3.js b/Sprint-1/2-mandatory-errors/3.js index ec101884db..4528c92323 100644 --- a/Sprint-1/2-mandatory-errors/3.js +++ b/Sprint-1/2-mandatory-errors/3.js @@ -1,5 +1,7 @@ -const cardNumber = 4533787178994213; -const last4Digits = cardNumber.slice(-4); +let cardNumber = 4533787178994213; +const ToString = cardNumber.toString(); +let last4Digits = ToString.slice(-4); +console.log(last4Digits); // The last4Digits variable should store the last 4 digits of cardNumber // However, the code isn't working From 220c59b44149c851d38a11a6a52f02fae4d85cc8 Mon Sep 17 00:00:00 2001 From: Sayeed Hussain Date: Thu, 18 Jun 2026 17:07:45 +0100 Subject: [PATCH 09/14] fix syntax error of variable name --- Sprint-1/2-mandatory-errors/4.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sprint-1/2-mandatory-errors/4.js b/Sprint-1/2-mandatory-errors/4.js index 5f86c730bc..8c150d752a 100644 --- a/Sprint-1/2-mandatory-errors/4.js +++ b/Sprint-1/2-mandatory-errors/4.js @@ -1,2 +1,3 @@ -const 12HourClockTime = "8:53pm"; -const 24hourClockTime = "20:53"; +const HourClockTime = "8:53pm"; +const hourClockTime = "20:53"; +// console.log(HourClockTime); From 3b6570f8c2439e51e144fb7c6d759b8fc4b9ac73 Mon Sep 17 00:00:00 2001 From: Sayeed Hussain Date: Fri, 19 Jun 2026 10:24:26 +0100 Subject: [PATCH 10/14] fix error and explain code execution --- Sprint-1/3-mandatory-interpret/1-percentage-change.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Sprint-1/3-mandatory-interpret/1-percentage-change.js b/Sprint-1/3-mandatory-interpret/1-percentage-change.js index e24ecb8e18..0fecd55c94 100644 --- a/Sprint-1/3-mandatory-interpret/1-percentage-change.js +++ b/Sprint-1/3-mandatory-interpret/1-percentage-change.js @@ -2,7 +2,7 @@ let carPrice = "10,000"; let priceAfterOneYear = "8,543"; carPrice = Number(carPrice.replaceAll(",", "")); -priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," "")); +priceAfterOneYear = Number(priceAfterOneYear.replaceAll(",", "")); const priceDifference = carPrice - priceAfterOneYear; const percentageChange = (priceDifference / carPrice) * 100; @@ -20,3 +20,9 @@ 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? + +// 1) five function call there including log function .Lines 4 has two function and lines 5 has two function . +// 2 ) problem was line number 5 where comma was missing. +// 3) reassignment statement lines are 4 and 5. +// 4) declaration lines are 1,2,7 and 8 +// 5) line number 4, first it is removing commas using replaceAll then converting string to number for calculation. From e9597fb5771756f352ac396db94e71d7cd5bf80f Mon Sep 17 00:00:00 2001 From: Sayeed Hussain Date: Fri, 19 Jun 2026 11:17:34 +0100 Subject: [PATCH 11/14] experiment code and explained execution --- Sprint-1/3-mandatory-interpret/2-time-format.js | 9 ++++++++- 1 file changed, 8 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 47d2395587..6108f20009 100644 --- a/Sprint-1/3-mandatory-interpret/2-time-format.js +++ b/Sprint-1/3-mandatory-interpret/2-time-format.js @@ -1,5 +1,5 @@ const movieLength = 8784; // length of movie in seconds - +// 9237, 8784, -5897... const remainingSeconds = movieLength % 60; const totalMinutes = (movieLength - remainingSeconds) / 60; @@ -23,3 +23,10 @@ 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) there are 6 variable declaration. +// b) there is zero function call . (only one is console.log but it is not part code execution) +// c)represents the number of seconds left over after converting the movie length into whole minutes. +// d) It calculates how many whole minutes are in the movie after taking away extra second that don't make full minutes. +// e) it represents time format like hours : minutes: second and I think MovieLengthDuration or short MovieDuration +// I think all value will work except negative value because negative value gives negative outcome. From ca85fbbd29b5f9b7bb5f766c4b58a71dc7851899 Mon Sep 17 00:00:00 2001 From: Sayeed Hussain Date: Fri, 19 Jun 2026 16:00:07 +0100 Subject: [PATCH 12/14] explained code execution --- Sprint-1/3-mandatory-interpret/3-to-pounds.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Sprint-1/3-mandatory-interpret/3-to-pounds.js b/Sprint-1/3-mandatory-interpret/3-to-pounds.js index 60c9ace69a..89b8ab03eb 100644 --- a/Sprint-1/3-mandatory-interpret/3-to-pounds.js +++ b/Sprint-1/3-mandatory-interpret/3-to-pounds.js @@ -25,3 +25,10 @@ console.log(`£${pounds}.${pence}`); // To begin, we can start with // 1. const penceString = "399p": initialises a string variable with the value "399p" + +// line 1 creating a string containing price in pence and this is starting value that programme will convert into pound. +// line 3 removing p from the end of 399p because p is not needed when converting into pound or pence. +// line 8 making sure string has at least 3 digit by adding zero if needed and this makes easier to separate pound and pence consistently. +// line 9 extract everything except last two digit . +// line 14 extract last two digit and padEnd() ensures the pence part always has 2 digits. +// line 18 to print value for checking . From 89778002937ba46a64802f8fe8dcf33b7fb35c92 Mon Sep 17 00:00:00 2001 From: Sayeed Hussain Date: Fri, 19 Jun 2026 16:54:00 +0100 Subject: [PATCH 13/14] executed code and explained how it worked --- Sprint-1/4-stretch-explore/chrome.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sprint-1/4-stretch-explore/chrome.md b/Sprint-1/4-stretch-explore/chrome.md index e7dd5feafe..0c280e9889 100644 --- a/Sprint-1/4-stretch-explore/chrome.md +++ b/Sprint-1/4-stretch-explore/chrome.md @@ -12,7 +12,11 @@ invoke the function `alert` with an input string of `"Hello world!"`; What effect does calling the `alert` function have? +1. alert function display a pop-up message box in the browser containing text "hello world" + Now try invoking the function `prompt` with a string input of `"What is your name?"` - store the return value of your call to `prompt` in an variable called `myName`. What effect does calling the `prompt` function have? What is the return value of `prompt`? + +2. calling a prompt display a pop-up message box and ask for user input and prompt return a text entered by user as string. From 6a11e8ed3bb5645cbc18e85a5c7dd262f5095fcd Mon Sep 17 00:00:00 2001 From: Sayeed Hussain Date: Fri, 19 Jun 2026 17:30:05 +0100 Subject: [PATCH 14/14] explained and checked how console work --- Sprint-1/4-stretch-explore/objects.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Sprint-1/4-stretch-explore/objects.md b/Sprint-1/4-stretch-explore/objects.md index 0216dee56a..31fb74f38a 100644 --- a/Sprint-1/4-stretch-explore/objects.md +++ b/Sprint-1/4-stretch-explore/objects.md @@ -6,11 +6,18 @@ Open the Chrome devtools Console, type in `console.log` and then hit enter What output do you get? +answer: it shows only log function itself. + Now enter just `console` in the Console, what output do you get back? +answer: the output is console object .it shows available function/ method inside console object. Try also entering `typeof console` +Answer: this shows that console is object. Answer the following questions: What does `console` store? +answer: this one store an object that contain method used to interact with browser developer console. + What does the syntax `console.log` or `console.assert` mean? In particular, what does the `.` mean? +Answer : this one let us access to log function that store console object. `.` this one is a dot operator used to access something inside object . console.assert means accessing the assert method from the console object.