challenge-algorithms-v2.0/02-triangleArea/index.js

8 lines
176 B
JavaScript
Raw Normal View History

export function triangleArea(base, height) {
2022-10-31 18:35:04 +00:00
return (base * height) / 2;
}
console.log(triangleArea(3,5));
console.log(triangleArea(5,5));
console.log(triangleArea(2,5));