File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Sprint-2/3-mandatory-implement Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ function calculateBMI(weight, height) {
1818 // return the BMI of someone based off their weight and height
1919 const heightSquared = height * height ; // square the height
2020 const bmi = weight / heightSquared ; // calculate BMI by dividing weight by height squared
21- const roundedBmi = bmi . toFixed ( 1 ) ; // round the result to 1 decimal place
22- return roundedBmi ; // return the rounded BMI value
21+ const roundedBmi = bmi . toFixed ( 1 ) ; // round the result to 1 decimal place and return as a string.
22+ return roundedBmi ; // return the string result of rounded BMI value
2323}
2424console . log ( calculateBMI ( 70 , 1.73 ) ) ; // Example usage: should return 23.4
25- console . log ( calculateBMI ( 80 , 1.8 ) ) ; // Example usage: should return 24.7
25+ console . log ( calculateBMI ( 80 , 1.8 ) ) ; // Example usage: should return 24.7
You can’t perform that action at this time.
0 commit comments