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

7 lines
132 B
JavaScript

export function triangleArea(base, height) {
// your code here
if (!base || !height) return 0;
return (base * height) / 2;
}