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

9 lines
229 B
JavaScript
Raw Normal View History

export function triangleArea(base, height) {
// your code here
2022-10-29 02:37:19 +00:00
if ((base > 0) && (height > 0)) {
let area = (base * height) / 2;
return area;
}
else
return console.log('Base e altura devem ser maior a 0')
}