File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Sprint-2/3-mandatory-implement Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 1616
1717function calculateBMI ( weight , height ) {
1818 // return the BMI of someone based off their weight and height
19+ // this will be a number to 1 decimal place
1920 const bmi = weight / ( height * height ) ; //calculation to calculate BMI
20- return bmi . toFixed ( 1 ) ;
21+ return Number ( bmi . toFixed ( 1 ) ) ;
2122}
2223console . log ( calculateBMI ( 70 , 1.73 ) ) ;
24+
25+ // tested and it works, the function calculates the BMI correctly and returns it to 1 decimal place.
Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ function toUpperSnakeCase(str) {
2424 // checks if the character is an uppercase letter or a digit
2525
2626 } ) . join ( '' ) ;
27- // joins the array of characters back into a single string and replaces spaces with underscores
27+ // joins the array of characters back into a single string and replaces spaces or special
28+ // characters such as "?" with underscores
2829}
2930
3031console . log ( toUpperSnakeCase ( "there-once was/a young lady from+London" ) ) ;
You can’t perform that action at this time.
0 commit comments