Skip to content

Commit aa32f0e

Browse files
refactored calculateBMI
1 parent 2eb14c0 commit aa32f0e

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎Sprint-3/3-mandatory-implement/1-bmi.js‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@
1515
// It should return a string of their Body Mass Index to 1 decimal place
1616

1717
function calculateBMI(weight, height) {
18-
let result = (weight/(height*height));
19-
result= Number(result.toFixed(1));
18+
let result = (weight/(height*height)).toFixed(1);
2019
return String(result)
2120

2221

2322
}
2423

25-
console.log(calculateBMI(70,1.7))
26-
console.log(calculateBMI(72,1.7))
24+
console.log(calculateBMI(81, 1.8))

0 commit comments

Comments
 (0)