Skip to content

Commit bcb3acd

Browse files
committed
updated information based on reviewer's feedback
1 parent c90f935 commit bcb3acd

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

Sprint-1/3-mandatory-interpret/1-percentage-change.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ console.log(`The percentage change is ${percentageChange}`);
2020

2121
// 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?
2222

23-
// The error is on line 5, where there is a syntax error in the replaceAll method call. The second argument is missing quotes.
24-
// To fix it, replaceAll needs two string arguments, e.g. replaceAll(",", "")
23+
//// In the original version, the error came from line 5 because the replaceAll call was not written correctly (the arguments weren’t separated properly),
24+
// So JavaScript couldn’t parse it.
25+
// Fix: pass two valid string arguments to replaceAll, e.g. replaceAll(",", "") so commas are removed before converting to a number.
2526

2627
// c) Identify all the lines that are variable reassignment statements
2728

Sprint-1/3-mandatory-interpret/3-to-pounds.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ const pence = paddedPenceNumberString
2525

2626
//This takes the last 2 digits to get the pence part (for "399" it becomes "99") and ensures it is always 2 digits long by padding with zeros on the right if needed.
2727

28+
//.padEnd(2, "0") is unnecessary here because paddedPenceNumberString is always at least length 3 due to padStart(3, "0"), so substring(length - 2) will always return exactly two characters. That means the pence part is already guaranteed to be 2 digits.
29+
2830
console.log(${pounds}.${pence}`);
2931

3032
// This prints the final formatted price by inserting pounds and pence into a template string, producing £3.99.

Sprint-1/4-stretch-explore/chrome.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ What effect does calling the `prompt` function have?
2222

2323
What is the return value of `prompt`?
2424

25-
- The return value is stored in a variable called myName
25+
- prompt returns the text the user type as a string (or null if they clicked cancel)

0 commit comments

Comments
 (0)