forked from M3-Academy/challenge-algorithms-v2.0
feat: resolve funcão triangleArea
This commit is contained in:
parent
2dfd633655
commit
e7bb1a6694
@ -1,3 +1,9 @@
|
|||||||
export function triangleArea(base, height) {
|
export function triangleArea(base, height) {
|
||||||
// your code here
|
// 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')
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user