Manchester | 26-ITP-Sep |Precious Moses | Sprint 3 | Course-work-3 - #1585
moses77-boop wants to merge 92 commits into
Conversation
…rd in passwordChecker.js
…s for various time formats and edge 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.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
iscmiguelsamaniego
left a comment
There was a problem hiding this comment.
Fantastic work on this! Using a regular expression for validation and writing such comprehensive test assertions makes this solution extremely robust. Great job overall—approved!
There was a problem hiding this comment.
Hello! Great job fixing the scope error.
Quick question: since the template string already produces the exact result you need, could you return it directly without reassigning the parameter, and how might that improve code simplicity?
There was a problem hiding this comment.
Thanks for feedback! I think I might have got carried away. I fixed it.
It would improve code simplicity as it cuts out an unnecessary step.
There was a problem hiding this comment.
Great job spotting the scope conflict and fixing the code.
Quick question: since decimalNumber * 100 is already a short expression, could you return it directly inside the template string without declaring a separate percentage variable?
There was a problem hiding this comment.
Thanks for the feedback. I just enjoy adding more details to my code
There was a problem hiding this comment.
Hello! Great job identifying why passing a number literal in a function definition causes a SyntaxError and fixing it with a proper parameter name.
Quick question: when naming parameters like n, how could choosing a more descriptive name (like number) help anyone reading your code understand its purpose even faster?
There was a problem hiding this comment.
Hello! Great job tracing the execution order and explaining why functions without a return statement default to returning undefined.
Quick question: since the function now uses return a * b, why is returning the value rather than using console.log inside the function considered a best practice in JavaScript?
There was a problem hiding this comment.
Thanks for the feedback!
Using return is considered as best practice because a function that only uses 'console.log' would not be able to parse output in an expression, but a function that returns a value stays flexible, I could choose not to log it.
There was a problem hiding this comment.
Hello! Great job spotting how automatic semicolon insertion affects the return statement and fixing it.
Quick question: since the expression a + b is short and simple, why might keeping it on the same line as return (like return a + b;) be preferred over putting it on a new line inside parentheses?
There was a problem hiding this comment.
Thanks for the feedback. I enjoy detailing my code. I'll fix it.
There was a problem hiding this comment.
Hello! Great job writing the calculateBMI function, handling edge cases for height, and using .toFixed(1) to return a clean string.
Quick question: since .toFixed() converts the number into a string, how might that affect any downstream code if another function tries to perform further mathematical calculations directly on the result of calculateBMI?
There was a problem hiding this comment.
Thanks for the feedback!
From research using turns into a string, rather than real numbers, so if further mathematical calculations are peformed directly on that result in some cases, it produces the wrong answer by joining the values together as text instead of adding them numerically and in other cases it fails strict equality comparison since a string and a number are never treated as equal.
I have made changes to the code so it can handle further mathematical calculations.
There was a problem hiding this comment.
Hello! Great job writing a robust function that handles extra spaces and validates the input type.
Quick question: since this is a fundamentals exercise, do you think using a regular expression like /\s+/ is necessary, or could a simpler method like .replaceAll() achieve the same result?
There was a problem hiding this comment.
Hello! Great job transforming the snippet into a reusable function and effectively handling different input lengths using string methods like padStart and padEnd.
Quick question: since your logic relies on removing the trailing 'p', how might your function behave if an input accidentally omits the 'p' or includes extra whitespace?
There was a problem hiding this comment.
Hello! Great job tracing the execution step by step and using temporary tracking variables to verify your answers.
Quick question: while using global variables helped you trace the code here, why can relying on global variables for tracking state be risky in larger applications?
There was a problem hiding this comment.
Hello! Great job writing thorough edge-case tests and using regular expressions to safely validate the 24-hour time format.
Quick question: since you added robust error handling and comprehensive test assertions, how does writing these tests before or alongside your implementation help you catch unexpected bugs earlier?

Self checklist
Task code
CYF-1053
Changelist
Completed all tasks including using predictions, reusing functions,understanding strings, invoking methods, BMI Calculation, time formatting and checks, conversion programs, using Python tutor code visualizer, and debugging