-
-
Notifications
You must be signed in to change notification settings - Fork 299
London | 26-ITP-January | Karla Grajales | Sprint 2 | Coursework/sprint 2 #925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…p ignoring parameters with hardcoded values
…e and remove the spaces and replace with underScores. I implement toUpperCase() and replace()
…umber and set the display result as Money
…e, one is to separate hours, minutes and seconds and the pad() is formatting the time displayed
LonMcGregor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done on this task so far, you have given good explanations to the debugging tasks.
I have left a couple of comments where you could improve further.
For learning, I would suggest understanding the basics before starting on using built-in functions. Something that might be interesting is seeing if you can write your own forEach or map function, and once you've got that down, then just using the built in functions.
| @@ -1,20 +1,41 @@ | |||
| // Predict and explain first... | |||
|
|
|||
| const { t } = require("tar"); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you requiring this "tar"?
|
|
||
| function convertToPercentage(num) { | ||
|
|
||
| const percentage = `${num * 100}%`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you simplify this to one line?
| // return the BMI of someone based off their weight and height | ||
| const squareHeight = height * height; | ||
| const operation = weight / squareHeight; | ||
| console.log(operation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good solution - do you need to keep this console.log if the solution is finished?
|
|
||
| function toPounds(str){ | ||
|
|
||
| const onlyNumbers = str.replace(/[^\d]/g, ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really interesting approach!
Learners, PR Template
Self checklist
Changelist
In this project, I implemented and refactored functions to handle data conversion (Time and Currency). I also documented the execution flow of nested functions and how parameters are processed when functions are invoked sequentially.
Questions
What is the most effective learning path for mastering functions: should I focus on core logic like loops first, or move directly to built-in array methods (like .forEach or .map)?