From 529b692747e606bfe34209aa06884434f7108698 Mon Sep 17 00:00:00 2001 From: HenriqueSSan Date: Thu, 27 Oct 2022 20:41:22 -0300 Subject: [PATCH] feat(challenge-2): completed challenge --- 02-triangleArea/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/02-triangleArea/index.js b/02-triangleArea/index.js index 7628fcd..4deaa85 100644 --- a/02-triangleArea/index.js +++ b/02-triangleArea/index.js @@ -1,3 +1,6 @@ -export function triangleArea(base, height) { +export function triangleArea(base, height) { // your code here -} \ No newline at end of file + if (!base || !height) return 0; + + return (base * height) / 2; +} -- 2.34.1