Birmingham | 26-ITP-JAN | Merve Reis | Sprint 2 | Module Structuring and Testing Data#1116
Birmingham | 26-ITP-JAN | Merve Reis | Sprint 2 | Module Structuring and Testing Data#1116mervereis wants to merge 11 commits intoCodeYourFuture:mainfrom
Conversation
Sprint-2/2-mandatory-debug/2.js
Outdated
|
|
||
| // Explain why the output is the way it is | ||
| // =============> write your explanation here | ||
| // The function `getLastDigit` is not taking any arguments, so it always returns the last digit which is 103. |
There was a problem hiding this comment.
Just a tiny detail on your first explanation: You wrote that it 'always returns the last digit which is 103'. To be super precise, it returns the string '3', which is the last digit of the global variable 103. But your logic and understanding are 100% correct!
There was a problem hiding this comment.
@tee4tao Sorry for my explanation is not well explained I tried to said same thing as you said in your comment. I updated the comment.
| // return the BMI of someone based off their weight and height | ||
| } No newline at end of file | ||
| // return the BMI of someone based off their weight and height | ||
| return Number((weight / (height * height)).toFixed(1)); |
There was a problem hiding this comment.
This is good and using height * height works perfectly for squaring! Out of curiosity, are you familiar with any JavaScript operators or Math methods that are specifically designed for calculating exponents?
There was a problem hiding this comment.
@tee4tao When I searched for it I found out i can write the code with math operator like this;
return Number((weight / (height ** 2)).toFixed(1));
| // You will need to come up with an appropriate name for the function | ||
| // 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 | ||
|
|
There was a problem hiding this comment.
You have not done the required exercise, any issue with that?
…lues and error handling
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.
1 similar comment
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Remove this file. I believe it's for another Sprint
Learners, PR Template
Self checklist
Changelist
I created/fixed functions and added comments for predicted issues on the existed code.