Westonci.ca is your go-to source for answers, with a community ready to provide accurate and timely information. Get immediate and reliable solutions to your questions from a knowledgeable community of professionals on our platform. Explore comprehensive solutions to your questions from knowledgeable professionals across various fields on our 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

We hope this information was helpful. Feel free to return anytime for more answers to your questions and concerns. Thank you for choosing our platform. We're dedicated to providing the best answers for all your questions. Visit us again. Thank you for using Westonci.ca. Come back for more in-depth answers to all your queries.