Skip to content

Step2-2#94

Merged
honux77 merged 2 commits intocode-squad:mukeunzifrom
mukeunzi:step2-2
Apr 16, 2019
Merged

Step2-2#94
honux77 merged 2 commits intocode-squad:mukeunzifrom
mukeunzi:step2-2

Conversation

@mukeunzi
Copy link
Copy Markdown

mukeunzi & circus

step 2-2 다각형의 넓이 - 함수구현

@@ -1,42 +1,65 @@
const PIE = Math.PI;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

변수명은 PI 가 좋을 듯?

let areaSum = 0;

module.exports.circle = function(r = -1){
function circle(r = -1){
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그냥 circle보다는 areaCircle 같이 조금 더 명확한 이름이 좋습니다.
circle이라고 하면 코드의 내용까지 읽어야 어떤 함수인지를 알 수 있죠.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

다시 읽어보니 모듈의 이름이 area라서 circle도 괜찮을 것 같아요 😉

checkParameter(r);

if(r > 0){
areaSum += Math.pow(r, 2) * PIE;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이미 있는 함수를 재활용하는게 좋지 않을까요?

Copy link
Copy Markdown

@honux77 honux77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

호출한 함수를 프린트하는 함수가 없네요. 더 구현해 주세요.

@@ -1,8 +1,10 @@
const PIE = Math.PI;
let areaSum = 0;
let stackList = [];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const를 써도 되겠죠?

@honux77 honux77 merged commit 69545b2 into code-squad:mukeunzi Apr 16, 2019
@honux77
Copy link
Copy Markdown

honux77 commented Apr 16, 2019

코멘트 내용도 잘 반영해 주세요. 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants