LONDON | ITP-MAY-25 | SURAFEL WORKNEH | Module-Structuring-and-Testing-Data | acoursework/sprint 2#667
LONDON | ITP-MAY-25 | SURAFEL WORKNEH | Module-Structuring-and-Testing-Data | acoursework/sprint 2#667SuWebOnes wants to merge 18 commits intoCodeYourFuture:mainfrom
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
cjyuan
left a comment
There was a problem hiding this comment.
Code looks good. Well done. I just have one question.
| // calculate the BMI | ||
| const BMI = weight / heightSquared; | ||
| // return the BMI to 1 decimal place | ||
| return BMI.toFixed(1); |
There was a problem hiding this comment.
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.
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.
You could also apply toUpperCase() to the whole string before split or after join.
|
Changes look good. |
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Data structure) doesn't match expected format (example: 'Sprint 2', without quotes) |
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Data structure) doesn't match expected format (example: 'Sprint 2', without quotes) |
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Structuring and testing data) doesn't match expected format (example: 'Sprint 2', without quotes) |
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Structuring and testing data) doesn't match expected format (example: 'Sprint 2', without quotes) |
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Structuring and testing data) doesn't match expected format (example: 'Sprint 2', without quotes) |
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (coursework) doesn't match expected format (example: 'Sprint 2', without quotes) |
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Wrong number of parts separated by |s |
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Module-Structuring-and-Testing-Data) doesn't match expected format (example: 'Sprint 2', without quotes) |
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Module-Structuring-and-Testing-Data) doesn't match expected format (example: 'Sprint 2', without quotes) |
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer.