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

7 lines
132 B
JavaScript
Raw Permalink Normal View History

2022-10-27 23:41:22 +00:00
export function triangleArea(base, height) {
// your code here
2022-10-27 23:41:22 +00:00
if (!base || !height) return 0;
return (base * height) / 2;
}