File tree Expand file tree Collapse file tree
Sprint-3/3-mandatory-implement Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717function calculateBMI ( weight , height ) {
1818 let bmiNum = weight / ( height * height ) ;
1919 bmiNum = bmiNum . toFixed ( 1 ) ;
20- return bmiNum ;
20+ return typeof bmiNum ;
2121}
2222
2323console . log ( calculateBMI ( 70 , 1.73 ) ) ;
24+
25+ // What type of value do you expect your function to return? A number or a string?
26+ //I expect function to return string as required, toFixed() change the type of number to a string.
27+
28+ // Does your function return the type of value you expect?
29+ //Yes I did expect a string returned.
30+
31+ // Different types of values may appear identical in the console output, but they are represented and treated differently in the program. For example,
32+
33+ // console.log(123); // Output 123(number)
34+ // console.log("123"); // Output 123(string)
35+
36+ // // Treated differently in the program
37+ // let sum1 = 123 + 100; // Evaluate to 223 -- a number
38+ // let sum 2 = "123" + 100; // Evaluate to "123100" -- a string.
You can’t perform that action at this time.
0 commit comments