-
-
Notifications
You must be signed in to change notification settings - Fork 195
London | 25-ITP-May | Surafel Workneh | Data structure | Sprint 2 | #667
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
…pdate comments for clarity Sprint-2/1-key-errors/0.js
…xplain Sprint-2/1-key-errors/1.js
… parameter definition and error explanation in Sprint-2/1-key-errors/2.js
…d explain function for clarity in Sprint-2/2-mandatory-debug/0.js
… return the sum of two numbers and explain code for clarity in Sprint-2/2-mandatory-debug/1.js
…x getLastDigit function to correctly return the last digit of a number and update comments for clarity in Sprint-2/2-mandatory-debug/2.js
…hy it always returns '3' in Sprint-2/2-mandatory-debug/2.js
…sed on weight and height, including detailed comments for clarity in Sprint-2/3-mandatory-implement/1-bmi.js
…KE_CASE with example usage Sprint-2/3-mandatory-implement/2-cases.js
…tted pounds with example usage Sprint-2/3-mandatory-implement/3-to-pounds.js
…d pad() in sprint -2/ time-format.js
…ps of input data or edge cases as you can, and fix any bugs in Sprint-2/5-stretch-extend/format-time.js
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.
Code looks good. Well done. I just have one question.
const BMI = weight / heightSquared; | ||
// return the BMI to 1 decimal place | ||
return BMI.toFixed(1); |
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.
What type of value do you expect the function to return? A number or a string?
Does your function return the type of value you expect it to return?
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.
number including decimals
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.
fixed to return type to numbers
//split the string into an array of words | ||
const wordsArray = string.split(" "); | ||
// Convert each word to uppercase | ||
const upperWordsArray = wordsArray.map((word) => word.toUpperCase()); | ||
// Join the array back into a string with underscores | ||
const toUpperSnakeCase = upperWordsArray.join("_"); | ||
// Return the string in UPPER_SNAKE_CASE | ||
return toUpperSnakeCase; |
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.
You could also apply toUpperCase()
to the whole string before split or after join.
Changes look good. |
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer.