Write a function that takes the base and height of a triangle and return its area.
Examples:
triArea(3, 2) ➞ 3
triArea(7, 4) ➞ 14
triArea(10, 10) ➞ 50
We will make a function triArea(base, height) which will take two values as parameters
Notes:
The area of a triangle is: (base * height) / 2
<script>
function triArea(base, height){
return (base * height) / 2; //it is better to use parenthesis in complex calculations.
}
triArea(3, 2) //output 3
triArea(7, 4) //output 14
triArea(10, 10) //output 50
</script>