forked from M3-Academy/challenge-algorithms-v2.0
9 lines
229 B
JavaScript
9 lines
229 B
JavaScript
export function triangleArea(base, height) {
|
|
// your code here
|
|
if ((base > 0) && (height > 0)) {
|
|
let area = (base * height) / 2;
|
|
return area;
|
|
}
|
|
else
|
|
return console.log('Base e altura devem ser maior a 0')
|
|
}
|