At Westonci.ca, we connect you with experts who provide detailed answers to your most pressing questions. Start exploring now! Experience the convenience of finding accurate answers to your questions from knowledgeable experts on our platform. Discover detailed answers to your questions from a wide network of experts on our comprehensive Q&A platform.

7.2.4 Area of Triangle HELP PLEASE!! (JAVA SCRIPT) I WILL WAIT FOR THE SOLUTION.

Write a function that computes the area of a triangle given its base and height.

The formula for an area of a triangle is:

AREA = 1/2 * BASE * HEIGHT
For example, if the base was 5 and the height was 4, the area would be 10.

triangleArea(5, 4); // should print 10
Your function must be named triangleArea


Sagot :

Answer:

function triangleArea(base, height) {

  console.log(base * height / 2)

}

Testing:

triangleArea(5, 4)

> 10

Thank you for your visit. We're committed to providing you with the best information available. Return anytime for more. We hope our answers were useful. Return anytime for more information and answers to any other questions you have. We're here to help at Westonci.ca. Keep visiting for the best answers to your questions.