Skip to content

정용준#2

Open
dkile wants to merge 8 commits intoyujo11:mainfrom
dkile:dkile
Open

정용준#2
dkile wants to merge 8 commits intoyujo11:mainfrom
dkile:dkile

Conversation

@dkile
Copy link

@dkile dkile commented Nov 10, 2023

  • 전체 기능 구현 완료
  • 멘토링 시간에 이야기 했던 수정사항 반영했습니다.

@dkile dkile marked this pull request as draft November 10, 2023 06:22
@dkile dkile changed the title Dkile 정용준 Nov 10, 2023
@dkile dkile marked this pull request as ready for review November 11, 2023 08:26
@dkile
Copy link
Author

dkile commented Nov 11, 2023

@yujo11

Copy link
Owner

@yujo11 yujo11 left a comment

Choose a reason for hiding this comment

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

안녕하세요 용준님~

간단한 코멘트 몇개 남겼는데 확인 부탁드립니다 ㅎㅎ

고생 많으셨어요~!

Comment on lines +16 to +19
<form>
<input type="text" id="user-input" />
<button id="submit">확인</button>
</form>
Copy link
Owner

Choose a reason for hiding this comment

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

👍 👍 👍

Copy link
Owner

Choose a reason for hiding this comment

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

깔끔하네요 👍 👍

resultEl.textContent = result;
};

submitBtnEl.addEventListener("click", handleSubmit);
Copy link
Owner

Choose a reason for hiding this comment

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

form을 사용하도록 변경해서 여기도 submit 이벤트를 활용해보시면 좋을거 같네요!

};

const handleSubmit = (e) => {
const userInputNumbers = Number(userInputEl?.value);
Copy link
Owner

Choose a reason for hiding this comment

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

submit event를 사용하면 다시 DOM에 접근해서 값을 가져오는게 아니라 전달 받은 Event 객체에서 값을 가져올 수 있을거 같네요 ㅎㅎ


const handleSubmit = (e) => {
const userInputNumbers = Number(userInputEl?.value);
const result = baseballGame.play(computerInputNumbers, userInputNumbers);
Copy link
Owner

Choose a reason for hiding this comment

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

result를 텍스트로 받아오고 있는데요. result에서 ball과 strike 개수를 받아서 처리해도 좋을거 같네요

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