At Westonci.ca, we connect you with the answers you need, thanks to our active and informed community. Get detailed and precise answers to your questions from a dedicated community of experts on our Q&A platform. Connect with a community of professionals ready to help you find accurate solutions to your questions quickly and efficiently.

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 trusting us with your questions. We're here to help you find accurate answers quickly and efficiently. We appreciate your visit. Our platform is always here to offer accurate and reliable answers. Return anytime. Westonci.ca is your go-to source for reliable answers. Return soon for more expert insights.