diff --git a/02-triangleArea/index.js b/02-triangleArea/index.js index 7628fcd..e8ea750 100644 --- a/02-triangleArea/index.js +++ b/02-triangleArea/index.js @@ -1,3 +1,9 @@ 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') } \ No newline at end of file