From beda3cd8081f9cb3935e94949f6d24b3f2429108 Mon Sep 17 00:00:00 2001 From: iswat Date: Sat, 4 Oct 2025 22:22:15 +0100 Subject: [PATCH 01/16] Add comment to explain what the assignment operator does on line 3 --- Sprint-1/1-key-exercises/1-count.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sprint-1/1-key-exercises/1-count.js b/Sprint-1/1-key-exercises/1-count.js index 117bcb2b6..72398bc71 100644 --- a/Sprint-1/1-key-exercises/1-count.js +++ b/Sprint-1/1-key-exercises/1-count.js @@ -1,6 +1,11 @@ let count = 0; count = count + 1; +console.log(count); // 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 + +//Answer +// The third line is a statement that reassigns the value of count to count + 1. +// The assignment operator (=) updates the variable count with a new value. From cdfcef07332b048e7d0b3eb28847bd74d38079df Mon Sep 17 00:00:00 2001 From: iswat Date: Sat, 4 Oct 2025 22:41:49 +0100 Subject: [PATCH 02/16] Write code to extract the first letter of each string --- 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..1f5c553b3 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(0) + middleName.charAt(0) + lastName.charAt(0); +console.log(initials); // https://www.google.com/search?q=get+first+character+of+string+mdn From d845bba79af5dafc2ab640a7e319f001b68969e1 Mon Sep 17 00:00:00 2001 From: iswat Date: Sat, 4 Oct 2025 23:14:33 +0100 Subject: [PATCH 03/16] Create variables to store the dir and ext parts of the filepath variable --- Sprint-1/1-key-exercises/3-paths.js | 7 +++++-- 1 file changed, 5 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..3dff7b81b 100644 --- a/Sprint-1/1-key-exercises/3-paths.js +++ b/Sprint-1/1-key-exercises/3-paths.js @@ -11,13 +11,16 @@ const filePath = "/Users/mitch/cyf/Module-JS1/week-1/interpret/file.txt"; const lastSlashIndex = filePath.lastIndexOf("/"); +console.log(lastSlashIndex); const base = filePath.slice(lastSlashIndex + 1); 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) ; +console.log(dir); +const ext = filePath.slice(lastSlashIndex + 1) ; +console.log(ext); // https://www.google.com/search?q=slice+mdn \ No newline at end of file From 2c9afad83add41a82956cf83ce9ff5a330f93695 Mon Sep 17 00:00:00 2001 From: iswat Date: Sun, 5 Oct 2025 17:38:32 +0100 Subject: [PATCH 04/16] Explain the expression assigned to const num --- Sprint-1/1-key-exercises/4-random.js | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Sprint-1/1-key-exercises/4-random.js b/Sprint-1/1-key-exercises/4-random.js index 292f83aab..ea35ba324 100644 --- a/Sprint-1/1-key-exercises/4-random.js +++ b/Sprint-1/1-key-exercises/4-random.js @@ -2,8 +2,32 @@ 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 + +//Answers +// num is a constant variable that stores a random integer between the minimum and maximum values (inclusive), generated using Math.random() and Math.floor() + + + +// Math.random() +// This expression gives you a random decimal number between 0 and 1. +// It could be something like 0.25 or 0.879, but it will never reach 1. + +// (maximum - minimum + 1) +// This expression calculates how many numbers are in the range you want. +// For example, if your range is 1 to 100, the result is 100 because there are 100 possible values. + +// Math.random() * (maximum - minimum + 1) +// This expression multiplies the random decimal by your range. + + +// Math.floor(...) +// This expression rounds the number down to the nearest integer. +// For example, 37.6 becomes 37, and 99.9 becomes 99. + +// + minimum +// Variable minimum is added to the expression "Math.floor(Math.random() * (maximum - minimum + 1))" and the the value is stored inside the variable num \ No newline at end of file From bbcddb9f553ce7cf611e442abd08399b60473b57 Mon Sep 17 00:00:00 2001 From: iswat Date: Tue, 7 Oct 2025 23:22:55 +0100 Subject: [PATCH 05/16] Interpret the error message --- Sprint-1/2-mandatory-errors/0.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Sprint-1/2-mandatory-errors/0.js b/Sprint-1/2-mandatory-errors/0.js index cf6c5039f..fe5e0f358 100644 --- a/Sprint-1/2-mandatory-errors/0.js +++ b/Sprint-1/2-mandatory-errors/0.js @@ -1,2 +1,11 @@ -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? + +// Interpretation: +// The error "SyntaxError: Unexpected identifier 'is'" means that JavaScript found the word "is", but it didn’t make sense in that position. +// It wasn’t valid code that JavaScript could understand. + +// Why the error occurred: +// The error occurred because the sentence was written as plain text instead of a comment. +// To fix it, the sentence should be written as a comment (by adding // at the beginning) so that JavaScript ignores it. + From 5b0c0bc5ed387bba69a55aa4e9d8495f3fe12202 Mon Sep 17 00:00:00 2001 From: iswat Date: Wed, 8 Oct 2025 09:47:25 +0100 Subject: [PATCH 06/16] Interpret error message when a const variable is reassigned --- Sprint-1/2-mandatory-errors/1.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sprint-1/2-mandatory-errors/1.js b/Sprint-1/2-mandatory-errors/1.js index 7a43cbea7..eb835305b 100644 --- a/Sprint-1/2-mandatory-errors/1.js +++ b/Sprint-1/2-mandatory-errors/1.js @@ -2,3 +2,7 @@ const age = 33; age = age + 1; + + +// The error message is "Assignment to constant variable", which means that a variable declared with the 'const' keyword +// cannot be reassigned to a new value after its initial declaration. From 08353466076e5ba43f5335dcda2217b5bbb68679 Mon Sep 17 00:00:00 2001 From: iswat Date: Wed, 8 Oct 2025 14:36:59 +0100 Subject: [PATCH 07/16] Interpret error message for when a variable is used before declaration --- Sprint-1/2-mandatory-errors/2.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sprint-1/2-mandatory-errors/2.js b/Sprint-1/2-mandatory-errors/2.js index e09b89831..7bf2655c2 100644 --- a/Sprint-1/2-mandatory-errors/2.js +++ b/Sprint-1/2-mandatory-errors/2.js @@ -3,3 +3,5 @@ console.log(`I was born in ${cityOfBirth}`); const cityOfBirth = "Bolton"; + +// The error message 'Cannot access 'cityOfBirth' before initialization' occured because the 'const' variable was used before it was declared. \ No newline at end of file From 2deec277e36b030ec27616b54ead84277c095862 Mon Sep 17 00:00:00 2001 From: iswat Date: Wed, 8 Oct 2025 15:12:57 +0100 Subject: [PATCH 08/16] Compare prediction with actual error message and fix the code --- Sprint-1/2-mandatory-errors/3.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Sprint-1/2-mandatory-errors/3.js b/Sprint-1/2-mandatory-errors/3.js index ec101884d..41d7c4210 100644 --- a/Sprint-1/2-mandatory-errors/3.js +++ b/Sprint-1/2-mandatory-errors/3.js @@ -1,5 +1,6 @@ -const cardNumber = 4533787178994213; -const last4Digits = cardNumber.slice(-4); +// const cardNumber = 4533787178994213; +// const last4Digits = cardNumber.slice(-4); + // The last4Digits variable should store the last 4 digits of cardNumber // However, the code isn't working @@ -7,3 +8,15 @@ 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 +// The code will not work because the slice method in javascript only works on a string or an array. +// The data type of the value stored in the variable cardNumber is a number and for this reason, the code will return an error. +// After running the code, it gave an error " TypeError: cardNumber.slice is not a function" +// My prediction and the error align. +// To update the code, I will convert the variable cardNumber to a string first then use slice() method after + +const cardNumber = 4533787178994213; +const last4Digits = cardNumber.toString().slice(-4); +console.log(last4Digits); From 2f25058f43b9432dea6b356110f85ac1547d5352 Mon Sep 17 00:00:00 2001 From: iswat Date: Wed, 8 Oct 2025 22:27:21 +0100 Subject: [PATCH 09/16] Interpret the error message that occurs when a number starts a variable name --- Sprint-1/2-mandatory-errors/4.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Sprint-1/2-mandatory-errors/4.js b/Sprint-1/2-mandatory-errors/4.js index 21dad8c5d..d76c5b493 100644 --- a/Sprint-1/2-mandatory-errors/4.js +++ b/Sprint-1/2-mandatory-errors/4.js @@ -1,2 +1,12 @@ const 12HourClockTime = "20:53"; -const 24hourClockTime = "08:53"; \ No newline at end of file +const 24hourClockTime = "08:53"; + +console.log(12HourClockTime , 24hourClockTime); + +// Answer +// After running the code, it gave an error message "SyntaxError: Invalid or unexpected token". +// This error means that Javascript was unable to read the code because a variable name cannot start with a number +// I can fix this code by removing the numbers from the start of the variable name + +const HourClockTime = "20:53"; +const hourClockTime = "08:53"; \ No newline at end of file From 4aaf4155cda65505bc89fcfa1195800b9ea4ab5b Mon Sep 17 00:00:00 2001 From: iswat Date: Wed, 8 Oct 2025 22:30:05 +0100 Subject: [PATCH 10/16] Comment out the code with the error --- 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 d76c5b493..c13b1bcb1 100644 --- a/Sprint-1/2-mandatory-errors/4.js +++ b/Sprint-1/2-mandatory-errors/4.js @@ -1,5 +1,5 @@ -const 12HourClockTime = "20:53"; -const 24hourClockTime = "08:53"; +// const 12HourClockTime = "20:53"; +// const 24hourClockTime = "08:53"; console.log(12HourClockTime , 24hourClockTime); From b9f2f51ec7de9a9e95af4e85fe38a74eeb9f9b8e Mon Sep 17 00:00:00 2001 From: iswat Date: Wed, 8 Oct 2025 23:16:36 +0100 Subject: [PATCH 11/16] Identify function calls, errors, variable declarations/reassignments, and explain Number(...replaceAll(...)) usage --- Sprint-1/3-mandatory-interpret/1-percentage-change.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Sprint-1/3-mandatory-interpret/1-percentage-change.js b/Sprint-1/3-mandatory-interpret/1-percentage-change.js index e24ecb8e1..2a8e70b64 100644 --- a/Sprint-1/3-mandatory-interpret/1-percentage-change.js +++ b/Sprint-1/3-mandatory-interpret/1-percentage-change.js @@ -1,8 +1,8 @@ let carPrice = "10,000"; let priceAfterOneYear = "8,543"; -carPrice = Number(carPrice.replaceAll(",", "")); -priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," "")); +carPrice = Number(carPrice.replaceAll("," ,"")); +priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," ,"")); const priceDifference = carPrice - priceAfterOneYear; const percentageChange = (priceDifference / carPrice) * 100; @@ -12,11 +12,17 @@ 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 +// Answer: There are five function calls in this file. function was called on line 4 (twice), line 5 (twice) and line 10. // 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? +// Answer: +// After running the code, the error occurred because a comma was missing between the quotation marks on line 5. I fixed it by adding the missing comma. // c) Identify all the lines that are variable reassignment statements +// Answer: Variable reassignment statements occurred on lines 4 and 5 // d) Identify all the lines that are variable declarations +// Answer: Variable declarations occurred on lines 1, 2, 7, and 8. // e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression? +// Answer: The .replaceAll() method runs first to find all the comma in the variable carPrice and replace them with nothing then the Number() functions runs to convert the value to a number data type \ No newline at end of file From 3090d19e6fb0f150b724df3c72474db2a270dd02 Mon Sep 17 00:00:00 2001 From: iswat Date: Wed, 8 Oct 2025 23:23:20 +0100 Subject: [PATCH 12/16] Comment out the console.log function --- Sprint-1/2-mandatory-errors/4.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-1/2-mandatory-errors/4.js b/Sprint-1/2-mandatory-errors/4.js index c13b1bcb1..d0d57e9e0 100644 --- a/Sprint-1/2-mandatory-errors/4.js +++ b/Sprint-1/2-mandatory-errors/4.js @@ -1,7 +1,7 @@ // const 12HourClockTime = "20:53"; // const 24hourClockTime = "08:53"; -console.log(12HourClockTime , 24hourClockTime); +// console.log(12HourClockTime , 24hourClockTime); // Answer // After running the code, it gave an error message "SyntaxError: Invalid or unexpected token". From 03cb4510e2da42912454ce380a08ef0fcdf9e251 Mon Sep 17 00:00:00 2001 From: iswat Date: Wed, 8 Oct 2025 23:56:43 +0100 Subject: [PATCH 13/16] Explain variables, function calls, expressions, and result interpretation in code --- 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 47d239558..5fe2e16a5 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 = 8974; // length of movie in seconds const remainingSeconds = movieLength % 60; const totalMinutes = (movieLength - remainingSeconds) / 60; @@ -12,14 +12,21 @@ 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? +//Answer: There are six variable declarations in this program // b) How many function calls are there? +// Answer: There is only one function call in the program // c) Using documentation, explain what the expression movieLength % 60 represents // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators +// Answer: The expression movieLength % 60 represents the remainder when movieLength is divided by 60 // d) Interpret line 4, what does the expression assigned to totalMinutes mean? +// Answer: The expression assigned to totalMinutes subtracts the leftover seconds from the movieLength and divide it by 60 to get the totalMinutes. +// This gives the total whole minutes of the movie without the leftover seconds. // e) What do you think the variable result represents? Can you think of a better name for this variable? +// Answer: The variable result represents the time in hours, minutes and seconds. A better name for the variable could be totalTime // f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer +// Answer: I tried different positive values of movieLength and the code worked for all but result variable returned a negative value when I tried a negative number as the variable movieLength From 095a3ea4d4ade0e2e83e4a96f702334c458b7aa6 Mon Sep 17 00:00:00 2001 From: iswat Date: Fri, 10 Oct 2025 11:08:57 +0100 Subject: [PATCH 14/16] Give a step-by-step breakdown of each line in this program --- Sprint-1/3-mandatory-interpret/3-to-pounds.js | 165 ++++++++++++++++++ 1 file changed, 165 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..5e6d57138 100644 --- a/Sprint-1/3-mandatory-interpret/3-to-pounds.js +++ b/Sprint-1/3-mandatory-interpret/3-to-pounds.js @@ -25,3 +25,168 @@ console.log(`£${pounds}.${pence}`); // To begin, we can start with // 1. const penceString = "399p": initialises a string variable with the value "399p" + +// Answer +const penceString = "399p" +// declares a variable penceString and assigns a value "399p" to it. + +const penceStringWithoutTrailingP = penceString.substring( + 0, + penceString.length - 1 +); +// Step-by-step breakdown +// 1. const + +// What it means: +// const is short for constant. +// It’s a keyword in JavaScript used to declare a variable — a named place in memory where we store a value. + +// What makes it special: +// Once you assign a value to a const variable, you cannot reassign it later. + +// 2. penceStringWithoutTrailingP + +// What it is: +// This is the name of the variable we’re creating. + + +// 3. = + +// What it means: +// The equals sign here means assignment, not comparison. +// It tells JavaScript: “Store the value on the right-hand side into the variable on the left-hand side.” + +// So, penceStringWithoutTrailingP will hold whatever value comes from the code on the right side. + +// 4. penceString + +// What it is: +// This is a variable that was created earlier in the code: + +// 4. .substring(...) + +// What it is: +// .substring() is a built-in method (a function that belongs to strings) in JavaScript. + +// What it does: +// It extracts a section (or slice) of a string, starting and ending at specific positions (index numbers). + +// The first number is where to start (inclusive). + +// The second number is where to stop (exclusive, it doesn’t include that index). + +// ( 0, penceString.length - 1 ) + +// These are the arguments (inputs) given to the substring() function. + +// Let’s understand each one: + +// 0 + +// This means: “Start from the very first character of the string.” +// In JavaScript, string positions start counting at 0, not 1. + +// penceString.length + +// .length is a property (not a function). +// It gives the number of characters in the string. + +// For "399p", penceString.length is 4. + +// penceString.length - 1 + +// This means “one less than the total length.” + +// 4 - 1 = 3. + +// So we’re telling JavaScript: “Stop right before the last character.” + +// Putting it all together: +// penceString.substring(0, penceString.length - 1) means “Take the text in penceString, start at position 0, and stop right before the last character.” +// So for "399p", it returns "399" — it removes the final p. +// The variable penceStringWithoutTrailingP will now contain: "399" + +const paddedPenceNumberString = penceStringWithoutTrailingP.padStart(3, "0"); +// Step-by-step breakdown +// 1. const + +// Keyword meaning: +// const is short for constant. +// It tells JavaScript that we’re creating a new variable whose value cannot be changed later. + +// Why use it here? +// We only need to store the processed result; we’re not planning to change it again. + +// 2. paddedPenceNumberString + +// This is the variable’s name. + +// 3. = + +// equals sign here is the assignment operator. + +// It means “store the result on the right-hand side into the variable on the left-hand side.” + +// 4. penceStringWithoutTrailingP + +// This is another variable that was defined earlier in the program. + +// It holds a string like "399", "50", or "5", after removing the “p” at the end of the original price (like "399p" → "399"). + +// 5. .padStart(3, "0") + +// This is a string method — something you can call on a string to make it do something. + +// Let’s break it down further: + +// a) The dot (.) + +// The dot connects the variable (penceStringWithoutTrailingP) with a method (a built-in action it can perform). + +// In English: “Hey JavaScript, take this string and do the padStart operation on it.” + +// b) padStart(...) + +// This is the method name. + +// It “pads” the start (the beginning) of a string with extra characters until it reaches a certain length. + +// c) The parentheses (3, "0") + +// These are the arguments — pieces of information you pass to the method. + +// The first argument (3) means: +// “Make the string at least 3 characters long.” + +// The second argument ("0") means: +// “If it’s shorter than that, add zeros ("0") at the start.” + +// Putting it all together +const paddedPenceNumberString = penceStringWithoutTrailingP.padStart(3, "0"); +// When JavaScript checks the length, it sees that it’s already 3 characters long, so it doesn’t add any zeros. +// the result "399" is stored in the variable "paddedPenceNumberString" + +const pounds = paddedPenceNumberString.substring( + 0, + paddedPenceNumberString.length - 2 +); +// paddedPenceNumberString.length means the length of the character "399" is 3. +// paddedPenceNumberString.length - 2 means 3 - 2 = 1 +// paddedPenceNumberString.substring(0 , 1) means take everything from position 0 up till position 1 exclusive. This will return 3 +// const pounds means store the value 3 inside the variable pounds. + +const pence = paddedPenceNumberString + .substring(paddedPenceNumberString.length - 2) + .padEnd(2, "0"); +// paddedPenceNumberString.length means the length of the character "399" is 3. +// paddedPenceNumberString.length - 2 means 3 - 2 = 1 +// .substring(paddedPenceNumberString.length - 2) means .substring(1) which means take everything from positon 1 to the end. This returns 99 +// .padEnd(2, "0") means make sure the string has at least two characters. If not, add zeros ("0") at the end. for this exercise, 99..padEnd(2, "0") will return 99 +// so, const pence means variable pence will store the value 99 + +console.log(`£${pounds}.${pence}`); +// console meaans terminal and log means print or show this message. +// `£${pounds}.${pence}` is a literal template which means £3.99 +// so, print £3.99 to the terminal + + From 10307642a7e5fc2b0256307583ff0ac258084723 Mon Sep 17 00:00:00 2001 From: iswat Date: Sat, 11 Oct 2025 15:26:15 +0100 Subject: [PATCH 15/16] Fix code to correctly extract the .txt file extension - Use lastIndexOf('.') and slice() to return '.txt' --- Sprint-1/1-key-exercises/3-paths.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sprint-1/1-key-exercises/3-paths.js b/Sprint-1/1-key-exercises/3-paths.js index 3dff7b81b..82ee01445 100644 --- a/Sprint-1/1-key-exercises/3-paths.js +++ b/Sprint-1/1-key-exercises/3-paths.js @@ -20,7 +20,9 @@ console.log(`The base part of ${filePath} is ${base}`); const dir = filePath.slice(0,lastSlashIndex) ; console.log(dir); -const ext = filePath.slice(lastSlashIndex + 1) ; +const lastDotIndex = base.lastIndexOf("."); +console.log(lastDotIndex); +const ext = base.slice(lastDotIndex) ; console.log(ext); // https://www.google.com/search?q=slice+mdn \ No newline at end of file From 11a2c209157a9588d297476ee1616a2c8cf3eab0 Mon Sep 17 00:00:00 2001 From: iswat Date: Sun, 12 Oct 2025 12:26:21 +0100 Subject: [PATCH 16/16] Rename variables to indicate 12-hour and 24-hour formats --- 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 d0d57e9e0..d1aff20b0 100644 --- a/Sprint-1/2-mandatory-errors/4.js +++ b/Sprint-1/2-mandatory-errors/4.js @@ -8,5 +8,5 @@ // This error means that Javascript was unable to read the code because a variable name cannot start with a number // I can fix this code by removing the numbers from the start of the variable name -const HourClockTime = "20:53"; -const hourClockTime = "08:53"; \ No newline at end of file +const time24HourFormat = "20:53"; +const time12HourFormat = "08:53"; \ No newline at end of file