Manchester | 26-ITP-Sep | Rahana Suleiman | Sprint 3 | Complete Sprint 3 Coursework - #1622
rahanasuleiman8-ship-it wants to merge 16 commits into
Conversation
…pdate comments - predict and explain the outcome of the code
…e convertToPercentage - Update console.log to pass argument to convertToPercentage instead of logging decimalNumber
- resolve parameter syntax error in square function
- Pass returned value into template literal expression
… explanations - Move expression a + b onto the same line as return keyword - Prevent the function from returning undefined on a newline
…ect last digit - Predict and explain hardcoded global variable behavior before fixing
- Chain toUpperCase() and replaceAll() to format spaces as underscores - Add console logs to verify the code is working
- Refactor time formatting functions for consistency and clarity - Explain string padding logic and modulo operator calculations for 61 seconds
…d add comprehensive test cases
✅ Deploy Preview for cyf-onboarding-module ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
cjyuan
left a comment
There was a problem hiding this comment.
Code looks good.
- In the PR description, could you restore the "Changelist" heading, and format it and the "Task code" heading as level 2 headings?
| const pence = paddedPenceNumberString | ||
| .substring(paddedPenceNumberString.length - 2) | ||
| .padEnd(2, "0"); | ||
|
|
||
| return (`£${pounds}.${pence}`) | ||
| }; |
There was a problem hiding this comment.
Indentation is off.
Have you installed the prettier VSCode extension and enabled "Format on save/paste" on VSCode,
as recommended in
https://github.com/CodeYourFuture/Module-Structuring-and-Testing-Data/blob/main/readme.md
?
| const hours = Number(time.slice(0, 2)); | ||
| if (hours > 12) { | ||
| return `${hours - 12}:00 pm`; | ||
| const minutes = time.slice(3, 5); |
There was a problem hiding this comment.
Note: The .slice() method supports negative indices, which count positions from the end of the string.
For example, str.slice(-3) returns the substring containing last three characters from str.
|
Hi @cjyuan, thank you for the review! I have updated the PR description with the ## level 2 headings, fixed the indentation in 3-to-pounds.js (and enabled Prettier "Format on Save" in VS Code), and simplified the string slicing in format-time.js using .slice(-2). Could you please take another look when you have a moment? |
|
Changes look good. Well done. |

Self checklist
Task code
CYF-1053
Changelist
This Pull Request completes the JavaScript fundamentals coursework for Sprint 3 by resolving core syntax errors, fixing variable scope and function return issues, and implementing key utility functions like BMI calculation, string case conversion, and currency formatting. It also documents line-by-line execution tracing for nested functions and refactors the formatAs12HourClock utility to accurately handle edge cases like midnight, noon, single-digit PM hours, and minute preservation—all backed by a full console.assert test suite.