Coding task · JavaScript and TypeScript course · Module 2: Functions, Arrays and Objects
Number Operations
Multiplication is *, division is /. Put the square of the height in parentheses, (heightM * heightM), because multiplication and division are evaluated from left to right.
Task
You have the data: const ageYears = 25, const weightKg = 8000 and const heightM = 5.6. Calculate ageDays, the age in days (a year has 365 days), and bmi, the weight divided by the square of the height. Display ageDays and bmi rounded to two decimal places (toFixed(2)) in the console.