From c16be6442e0c08def3725cf6ce36320e178f5b87 Mon Sep 17 00:00:00 2001 From: Ihor Taradaiko Date: Sat, 7 Feb 2026 11:33:49 +0000 Subject: [PATCH 01/13] Key 1-count done --- Sprint-1/1-key-exercises/1-count.js | 4 ++++ prep/first file | 0 2 files changed, 4 insertions(+) create mode 100644 prep/first file diff --git a/Sprint-1/1-key-exercises/1-count.js b/Sprint-1/1-key-exercises/1-count.js index 117bcb2b6..c176925a9 100644 --- a/Sprint-1/1-key-exercises/1-count.js +++ b/Sprint-1/1-key-exercises/1-count.js @@ -2,5 +2,9 @@ let count = 0; 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 +//It takes the current value of count, add 1 to it \ No newline at end of file diff --git a/prep/first file b/prep/first file new file mode 100644 index 000000000..e69de29bb From 9b0dde9ffa786be386b32521c7281affa506067d Mon Sep 17 00:00:00 2001 From: Ihor Taradaiko Date: Sat, 7 Feb 2026 11:43:30 +0000 Subject: [PATCH 02/13] 2-initials done --- Sprint-1/1-key-exercises/2-initials.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sprint-1/1-key-exercises/2-initials.js b/Sprint-1/1-key-exercises/2-initials.js index 47561f617..ca7f369ab 100644 --- a/Sprint-1/1-key-exercises/2-initials.js +++ b/Sprint-1/1-key-exercises/2-initials.js @@ -5,7 +5,8 @@ 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()}${middleName.charAt()}${lastName.charAt()} `; +console.log(initials) // https://www.google.com/search?q=get+first+character+of+string+mdn From 2af0341d9222a48e98a10bd5324fd665f0636434 Mon Sep 17 00:00:00 2001 From: Ihor Taradaiko Date: Sat, 7 Feb 2026 11:52:44 +0000 Subject: [PATCH 03/13] 3-paths done --- Sprint-1/1-key-exercises/3-paths.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Sprint-1/1-key-exercises/3-paths.js b/Sprint-1/1-key-exercises/3-paths.js index ab90ebb28..a4a4e4aac 100644 --- a/Sprint-1/1-key-exercises/3-paths.js +++ b/Sprint-1/1-key-exercises/3-paths.js @@ -16,8 +16,9 @@ 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 lastDotIndex = filePath.lastIndexOf("."); +const dir = filePath.slice(0, lastSlashIndex); +const ext = filePath.slice(lastDotIndex); +console.log(dir,ext) // https://www.google.com/search?q=slice+mdn \ No newline at end of file From 82eeb813b0e6e43f06fb4e17449d0a19f3e8cf7d Mon Sep 17 00:00:00 2001 From: Ihor Taradaiko Date: Sat, 7 Feb 2026 11:58:35 +0000 Subject: [PATCH 04/13] 4-random done --- Sprint-1/1-key-exercises/4-random.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sprint-1/1-key-exercises/4-random.js b/Sprint-1/1-key-exercises/4-random.js index 292f83aab..bee72e947 100644 --- a/Sprint-1/1-key-exercises/4-random.js +++ b/Sprint-1/1-key-exercises/4-random.js @@ -2,8 +2,10 @@ const minimum = 1; const maximum = 100; const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum; +console.log(num) // In this exercise, you will need to work out what num represents? // 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 +//results: 4,23,91,46 the program is giving you a random number while math.random give you a random decimal number math.floor rounds the total number up \ No newline at end of file From b0a547caf228987b921b2971823dc76593b1547e Mon Sep 17 00:00:00 2001 From: Ihor Taradaiko Date: Sat, 7 Feb 2026 11:59:40 +0000 Subject: [PATCH 05/13] 0 done --- Sprint-1/2-mandatory-errors/0.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sprint-1/2-mandatory-errors/0.js b/Sprint-1/2-mandatory-errors/0.js index cf6c5039f..1bcb690f7 100644 --- a/Sprint-1/2-mandatory-errors/0.js +++ b/Sprint-1/2-mandatory-errors/0.js @@ -1,2 +1,3 @@ -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? +// comment them \ No newline at end of file From b71098385e89f2fac808ea4ad109603c7d0a09d3 Mon Sep 17 00:00:00 2001 From: Ihor Taradaiko Date: Sat, 7 Feb 2026 12:02:45 +0000 Subject: [PATCH 06/13] 1 done --- Sprint-1/2-mandatory-errors/1.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sprint-1/2-mandatory-errors/1.js b/Sprint-1/2-mandatory-errors/1.js index 7a43cbea7..779b74127 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; -age = age + 1; +let age = 33; +age = age+1 +console.log(age) \ No newline at end of file From 9514edfe69072a24fd982f875f972a0cb20c08df Mon Sep 17 00:00:00 2001 From: Ihor Taradaiko Date: Sat, 7 Feb 2026 12:22:17 +0000 Subject: [PATCH 07/13] error 2 done --- Sprint-1/2-mandatory-errors/1.js | 4 +++- Sprint-1/2-mandatory-errors/2.js | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Sprint-1/2-mandatory-errors/1.js b/Sprint-1/2-mandatory-errors/1.js index 779b74127..d16baccaf 100644 --- a/Sprint-1/2-mandatory-errors/1.js +++ b/Sprint-1/2-mandatory-errors/1.js @@ -2,4 +2,6 @@ let age = 33; age = age+1 -console.log(age) \ No newline at end of file +console.log(age) + +//const sets the value as a constant you can't change \ No newline at end of file diff --git a/Sprint-1/2-mandatory-errors/2.js b/Sprint-1/2-mandatory-errors/2.js index e09b89831..f6aa83652 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}`); + +//wrong order \ No newline at end of file From a13b66664c9df4fa529602db67cf2dbe117c3e7e Mon Sep 17 00:00:00 2001 From: Ihor Taradaiko Date: Sat, 7 Feb 2026 12:32:32 +0000 Subject: [PATCH 08/13] error 3 done --- Sprint-1/2-mandatory-errors/3.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Sprint-1/2-mandatory-errors/3.js b/Sprint-1/2-mandatory-errors/3.js index ec101884d..00fd3375c 100644 --- a/Sprint-1/2-mandatory-errors/3.js +++ b/Sprint-1/2-mandatory-errors/3.js @@ -1,9 +1,13 @@ -const cardNumber = 4533787178994213; -const last4Digits = cardNumber.slice(-4); - +function digits() { + const cardNumber = 4533787178994213; + const last4Digits = String(cardNumber).slice(-4); + return last4Digits; +}console.log(digits()) // The last4Digits variable should store the last 4 digits of cardNumber // However, the code isn't working // Before running the code, make and explain a prediction about why the code won't work // 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 + +//Numbers don’t have .slice(), so we convert the number to a string \ No newline at end of file From ff43f7de866e9f92e1fa8ae77e018952c2694c3e Mon Sep 17 00:00:00 2001 From: Ihor Taradaiko Date: Sat, 7 Feb 2026 13:43:18 +0000 Subject: [PATCH 09/13] 1-interpret done --- Sprint-1/2-mandatory-errors/4.js | 11 +++++++++-- Sprint-1/3-mandatory-interpret/1-percentage-change.js | 11 ++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Sprint-1/2-mandatory-errors/4.js b/Sprint-1/2-mandatory-errors/4.js index 21dad8c5d..81500e797 100644 --- a/Sprint-1/2-mandatory-errors/4.js +++ b/Sprint-1/2-mandatory-errors/4.js @@ -1,2 +1,9 @@ -const 12HourClockTime = "20:53"; -const 24hourClockTime = "08:53"; \ No newline at end of file +// const 12HourClockTime = "20:53"; +// const 24hourClockTime = "08:53"; + +//answer + +const HourClockTime24 = "20:53"; +const hourClockTime12 = "08:53"; + +// you can't start a parameter with the number, also the values did not match logically to the parameter \ No newline at end of file diff --git a/Sprint-1/3-mandatory-interpret/1-percentage-change.js b/Sprint-1/3-mandatory-interpret/1-percentage-change.js index e24ecb8e1..e20cd7fbc 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; @@ -12,11 +12,12 @@ console.log(`The percentage change is ${percentageChange}`); // Read the code and then answer the questions below // a) How many function calls are there in this file? Write down all the lines where a function call is made - +//4,5,11 // b) Run the code and identify the line where the error is coming from - why is this error occurring? How can you fix this problem? - +//line 5, added come before "" // c) Identify all the lines that are variable reassignment statements - +//4,5 // d) Identify all the lines that are variable declarations - +//1,2,7,8 // e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression? +//removes commas / Converts the string "10000" into the number \ No newline at end of file From 6cd17cc9ad7a9975aa1691645d5703d106cfaf4d Mon Sep 17 00:00:00 2001 From: Ihor Taradaiko Date: Sat, 7 Feb 2026 13:47:04 +0000 Subject: [PATCH 10/13] 2-interpret done --- Sprint-1/3-mandatory-interpret/2-time-format.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Sprint-1/3-mandatory-interpret/2-time-format.js b/Sprint-1/3-mandatory-interpret/2-time-format.js index 47d239558..c296dfcdc 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 = 2600; // length of movie in seconds const remainingSeconds = movieLength % 60; const totalMinutes = (movieLength - remainingSeconds) / 60; @@ -12,14 +12,16 @@ console.log(result); // For the piece of code above, read the code and then answer the following questions // a) How many variable declarations are there in this program? - +//6 // b) How many function calls are there? - +// // c) Using documentation, explain what the expression movieLength % 60 represents // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators +//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. // d) Interpret line 4, what does the expression assigned to totalMinutes mean? - +//math expression // e) What do you think the variable result represents? Can you think of a better name for this variable? - +//maybe timeLeft or similar // f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer +// \ No newline at end of file From 4a7731e47f8c7f432e75280e4d9da0e9355d63aa Mon Sep 17 00:00:00 2001 From: Ihor Taradaiko Date: Sat, 7 Feb 2026 14:28:11 +0000 Subject: [PATCH 11/13] 3-interpret done --- Sprint-1/3-mandatory-interpret/3-to-pounds.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Sprint-1/3-mandatory-interpret/3-to-pounds.js b/Sprint-1/3-mandatory-interpret/3-to-pounds.js index 60c9ace69..a942afa15 100644 --- a/Sprint-1/3-mandatory-interpret/3-to-pounds.js +++ b/Sprint-1/3-mandatory-interpret/3-to-pounds.js @@ -1,21 +1,23 @@ const penceString = "399p"; - +// 1. const penceString = "399p": initialises a string variable with the value "399p" const penceStringWithoutTrailingP = penceString.substring( 0, penceString.length - 1 ); - +//2. removes "P" from the string const paddedPenceNumberString = penceStringWithoutTrailingP.padStart(3, "0"); +//3. Ensures the string is at least 3 characters long by adding 0 to the start const pounds = paddedPenceNumberString.substring( 0, paddedPenceNumberString.length - 2 ); - +//4. Extracts everything except the last 2 digits of paddedPenceNumberString const pence = paddedPenceNumberString .substring(paddedPenceNumberString.length - 2) .padEnd(2, "0"); - +//5. takes the last 2 digits as the pence from paddedPenceNumberString console.log(`£${pounds}.${pence}`); +//6. Prints the formatted pounds-and-pence value // This program takes a string representing a price in pence // The program then builds up a string representing the price in pounds From 27273952a1ce0796babd8cad01c7c12ed7fbbf8d Mon Sep 17 00:00:00 2001 From: Ihor Taradaiko Date: Sat, 7 Feb 2026 14:49:49 +0000 Subject: [PATCH 12/13] stretch-explore done --- Sprint-1/4-stretch-explore/chrome.md | 8 ++++---- Sprint-1/4-stretch-explore/objects.md | 8 +++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Sprint-1/4-stretch-explore/chrome.md b/Sprint-1/4-stretch-explore/chrome.md index e7dd5feaf..121fde828 100644 --- a/Sprint-1/4-stretch-explore/chrome.md +++ b/Sprint-1/4-stretch-explore/chrome.md @@ -11,8 +11,8 @@ In the Chrome console, invoke the function `alert` with an input string of `"Hello world!"`; What effect does calling the `alert` function have? - +//Shows an alert 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`? +//shows a pop-up to enter a name / stores and shows name +What effect does calling the `prompt` function have? //shows pop-up form +What is the return value of `prompt`? //if myName is set returns myName value diff --git a/Sprint-1/4-stretch-explore/objects.md b/Sprint-1/4-stretch-explore/objects.md index 0216dee56..b9d204d90 100644 --- a/Sprint-1/4-stretch-explore/objects.md +++ b/Sprint-1/4-stretch-explore/objects.md @@ -4,13 +4,15 @@ In this activity, we'll explore some additional concepts that you'll encounter i Open the Chrome devtools Console, type in `console.log` and then hit enter -What output do you get? +What output do you get?// ƒ log() { [native code] } Now enter just `console` in the Console, what output do you get back? - +// console {debug: ƒ, error: ƒ, info: ƒ, log: ƒ, warn: ƒ, …} Try also entering `typeof console` - +// 'object' Answer the following questions: What does `console` store? +//stores an object that contains lots of built-in debugging functions What does the syntax `console.log` or `console.assert` mean? In particular, what does the `.` mean? +//means “get the log (or assert) property from the console object” \ No newline at end of file From e401a845af27d3dc299caea005d0968b6366e4d4 Mon Sep 17 00:00:00 2001 From: Ihor Taradaiko Date: Sat, 7 Feb 2026 15:01:50 +0000 Subject: [PATCH 13/13] changes --- prep/first file | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 prep/first file diff --git a/prep/first file b/prep/first file deleted file mode 100644 index e69de29bb..000000000