Loading...
Please wait while we prepare your content
Welcome to JavaScript Playground Level 3! These advanced exercises will challenge your understanding of conditional logic, array manipulation, and object processing. You'll work with BMI calculations, caloric impact analysis, and price calculations from complex data structures.
Each problem builds on fundamental programming concepts while introducing more sophisticated data handling techniques.
bodyType(height, weight) that takes two arguments: height in meters and weight in kilograms. The function should compute the BMI using the formula:
BMI = weight / (height * height)
Then return a string based on the following classification:
• 'underweight' if BMI < 18
• 'normal weight' if 18 ≤ BMI < 25
• 'overweight' if 25 ≤ BMI < 30
• 'obesity' if BMI ≥ 30totalKcal(arr) where arr is an array of integers representing daily calorie consumption. For each day:
• Subtract 2000 from the calorie count.
• Divide the result by 7700 (the number of kcal required to gain or lose 1 kg).
• Sum all the results to get the total weight change in kilograms.totalPrice(arr) where arr is an array of objects. Each object has a name and a price field. The function should return the sum of all the price values.