West Midlands | 26-Jan-ITP | Fida H Ali Zada | Sprint 2 | coursework/sprint-2#946
West Midlands | 26-Jan-ITP | Fida H Ali Zada | Sprint 2 | coursework/sprint-2#946alizada-dev wants to merge 8 commits intoCodeYourFuture:mainfrom
Conversation
| function calculateBMI(weight, height) { | ||
| // return the BMI of someone based off their weight and height | ||
| } No newline at end of file | ||
| let bmi = weight / (height * height); |
There was a problem hiding this comment.
I noticed you've used let here and in most other places. Could we use another keyword which might be a better fit?
There was a problem hiding this comment.
I used const instead of let
| // Use the MDN string documentation to help you find a solution | ||
| // This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase | ||
|
|
||
| function toUpperSnake(str) { |
There was a problem hiding this comment.
I like the name because it's descriptive. 👌
Do you think it could be improved if we make it consistent with the existing toUpperCase?
(Btw, just asking out of curiosity. There is no single right answer.)
There was a problem hiding this comment.
I changed toUpperSnake() name to toUpperSnakeCase()
I hope this is what you meant
| function toPounds(penceString) { | ||
| let value = Number(penceString.slice(0, -1)) / 100; | ||
| return `£${value.toFixed(2)}` | ||
| } |
There was a problem hiding this comment.
Nice! The code is very readable. 👍
| currentOutput === targetOutput, | ||
| `current output: ${currentOutput}, target output: ${targetOutput}` | ||
| ); | ||
|
|
There was a problem hiding this comment.
I think this test is failing. Could you double check?
There was a problem hiding this comment.
Yes, it was failing. Fixed the issue by writing this code hours = hours < 10 ? '0'+hours : hours;
Learners, PR Template
Self checklist
Changelist
Completed the Sprint-2 coursework exercises of the Structuring and Testing Data module.