πŸ’ͺ JavaScript Coding Challenge: Comparing BMIs with Objects

Let's go back to Mark and John comparing their BMIs!

This time, you'll use JavaScript objects to implement the BMI calculations.

πŸ’‘ Remember:
BMI formula = mass / (height Γ— height)
(mass in kg and height in meters)


πŸ“ Your Tasks

  1. Create two objects:

    ⚠️ Use the exact object names mark and john, and the property names fullName, mass, and height.

  2. Add a method calcBMI to each object that:

  3. Compare BMIs:


πŸ“Š Test Data


βœ… Example Output

"John Smith's BMI (24.2) is higher than Mark Miller's (23.9)!"

🧠 Bonus Tip

Make sure you’re using methods and the this keyword properly inside the objects!

Happy coding! πŸš€