File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ const num = 103;
1111function getLastDigit ( ) {
1212 return num . toString ( ) . slice ( - 1 ) ;
1313}
14- //
14+
1515console . log ( `The last digit of 42 is ${ getLastDigit ( 42 ) } ` ) ;
1616console . log ( `The last digit of 105 is ${ getLastDigit ( 105 ) } ` ) ;
1717console . log ( `The last digit of 806 is ${ getLastDigit ( 806 ) } ` ) ;
Original file line number Diff line number Diff line change 33// The BMI calculation divides an adult's weight in kilograms (kg) by their height in metres (m) squared.
44
55// For example, if you weigh 70kg (around 11 stone) and are 1.73m (around 5 feet 8 inches) tall, you work out your BMI by:
6-
6+ //
77// squaring your height: 1.73 x 1.73 = 2.99
88// dividing 70 by 2.99 = 23.41
99// Your result will be displayed to 1 decimal place, for example 23.4.
1515// It should return their Body Mass Index to 1 decimal place
1616
1717function calculateBMI ( weight , height ) {
18- return BMI = ( weight / ( height * height ) ) . toFixed ( 1 ) ; // return the BMI of someone based off their weight and height
18+ return ( BMI = ( weight / ( height * height ) ) . toFixed ( 1 ) ) ; // return the BMI of someone based off their weight and height
1919}
2020console . log ( calculateBMI ( 90 , 1.77 ) ) ; // when calling this function with given someone's weight and height
You can’t perform that action at this time.
0 commit comments