Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDSC SKHU Web - 전유진 #3

Merged
merged 4 commits into from
Nov 9, 2022
Merged

Conversation

yuj2n
Copy link
Contributor

@yuj2n yuj2n commented Nov 8, 2022

Description

구현 및 작업 내용을 적어주세요.

  • table을 이용한 계산기 작성
  • onclick 이벤트를 통해 함수를 발생시켜 계산
  • 연산기호가 연속으로 나오거나 초기값으로 +나 숫자가 아닌값이 올 수 없도록 js 작성

Important content

주의 깊게 봐야 하거나 말하고 싶은 점을 적어주세요.

  • hover & 클릭 시 색 변화를 주어 동적인 느낌 표현
  • css를 통해 숫자와 operator 구분 및 디자인 적용
  • eval이 아닌 직접 함수를 작성하여 만들어보고 싶고 키보드를 이용한 입력 기능 추가 희망
  • table 방식이 아닌 div 태그를 중복 작성 또는 button태그를 통해 만드는 방식도 만들어보고 싶음.

Reference

참고한 레퍼런스가 있다면 기록해주세요.

  • https://blog.cordelia273.space/32
  • 아직은 자바스크립트와 구조 작성에 대해서 많이 미숙하여 구글링에 많이 의존하지만
    후에 직접 획기적인 코드를 작성할 수 있으면 좋겠음.

Copy link
Member

@hyesungoh hyesungoh left a comment

Choose a reason for hiding this comment

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

👍 👍 👍

고생하셨어요 👍

은지님의 과제와 비슷한 부분이 많아, 은지님의 PR 또한 확인해 주시길 부탁드려요 !

#1

assignment.js Outdated
document.getElementById('display').value += char;
}

if(isNaN(char)==true) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if(isNaN(char)==true) {
if(Number.isNaN(char)==true) {

isNaN의 경우 아래 링크에서 Number.isNaN으로 바꾸는 것을 권장하고 있어요!

확인해 보시면 좋을 듯 합니다 ~
https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/isNaN

Copy link
Contributor Author

@yuj2n yuj2n Nov 9, 2022

Choose a reason for hiding this comment

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

혹시 Number.isNaN으로 바꾸는 경우 연산기호가 연달아 나오게 되는데 어떻게 해결할 수 있나요?

assignment.js Outdated
document.getElementById('display').value += char;
}
} else { // 이전에 숫자 입력시
document.getElementById('display').value += char;
Copy link
Member

Choose a reason for hiding this comment

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

이렇게 if depth가 깊어진다면 clean code에서 흔히 말하곤 하는 early return 을 생각해 보시는 것을 추천드려요

https://jheloper.github.io/2019/06/write-early-return-code/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

감사합니다. 한 번 시도해볼게요!

@hyesungoh hyesungoh self-requested a review November 9, 2022 05:52
Copy link
Member

@hyesungoh hyesungoh left a comment

Choose a reason for hiding this comment

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

유진님 ./전유진/assignment.css 처럼 폴더 안에 넣어주셔야 돼요~

@hyesungoh
Copy link
Member

이렇게 PR을 올린 후에 변화가 있을 때는, 다시 브랜치를 만드는 게 아니라

PR을 올린 브랜치에 다시 커밋하면 변경 사항이 적용 됩니다 ! @yuj2n

@hyesungoh hyesungoh self-requested a review November 9, 2022 12:37
Copy link
Member

@hyesungoh hyesungoh left a comment

Choose a reason for hiding this comment

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

스크린샷 2022-11-09 오후 9 38 09

기존에 루트에 있는 파일들 지워주세요 ~

Copy link
Contributor

@NohWookJin NohWookJin left a comment

Choose a reason for hiding this comment

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

죄송해용 제가 2000원 내겠습니당 ㅋㅋㅋㅋㅋ

assignment.css Outdated Show resolved Hide resolved
@hanseulhee hanseulhee merged commit 8c37bf1 into GDG-on-Campus-SKHU:main Nov 9, 2022
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.

4 participants