Study/Today I Learn
2019. 4. 9.
[TIL] 2019.04.09 - 다각형 넓이 구하기 (2)
다각형의 넓이 구하기 - getArea() 함수 구현 const { PI, pow } = Math; const logArr = [], logRes = []; const CIRCLE_NAME = "circle", RECT_NAME = "rect", TRAPE_NAME = "trapezoid"; const printExecutionSequence = _ => { let log = ""; log = logArr.map((el, i) => `${logArr[i]} ${logRes[i]}`) .reduce((a, b) => `${a}, ${b}`, log); console.log(log); }; const logExecution = (polygonName, polygonArea) => { logArr.push(p..