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

10 lines
250 B
JavaScript
Raw Normal View History

export function triangleArea(base, height) {
// your code here
2022-11-02 15:58:46 +00:00
return base * height / 2
}
// Resultados esperados
console.log(triangleArea(3, 5), 7.5) // 7.5
console.log(triangleArea(5, 5), 12.5) // 12.5
console.log(triangleArea(2, 5), 5) // 5