We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 20a496c commit 82fccd4Copy full SHA for 82fccd4
Sprint-2/3-mandatory-implement/1-bmi.js
@@ -17,8 +17,8 @@
17
18
// return the BMI of someone based off their weight and height
19
function calculateBMI(weight, height) {
20
- return (weight/(Math.pow(height, 2))).toFixed(1);
21
-
+ return Number((weight / (height ** 2)).toFixed(1));// returns a number
+ // return (weight/(Math.pow(height, 2))).toFixed(1);// returns a string
22
}
23
console.log(calculateBMI(100, 1.6)); //print 39.1
24
console.log(calculateBMI(55, 1.6)); //print 21.5
0 commit comments