-
Notifications
You must be signed in to change notification settings - Fork 15
[김아영_FrontEnd] 3주차 과제 제출합니다. #29
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
base: main
Are you sure you want to change the base?
Conversation
dooohun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다!
코드 리뷰 남긴 거 확인해주고 답변 꼭 달아주세요~
| "type": "chrome", | ||
| "request": "launch", | ||
| "name": "Launch Chrome against localhost", | ||
| "url": "http://localhost:8080", | ||
| "webRoot": "${workspaceFolder}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.vscode 에 다양한 설정을 할 수 있습니다! 개발자 경험(DX)을 향상시킬 때 큰 도움이 됩니다.
특히 협업 및 팀프로젝트를 진행할 때 모두 동일한 환경에서 개발을 할 수 있도록 도와줍니다.
다양한 시도는 언제나 좋습니다~👍
| let correctNumbers = []; | ||
| let userNumbersList = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
객체 타입을 선언할 때 let과 const의 차이점은 무엇일까요?
만약 const를 사용한다면 어떤 이점이 있을까요?
| } | ||
|
|
||
| purchaseQuantityInput.addEventListener('input', function () { | ||
| const count = parseInt(purchaseQuantityInput.value) || 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
purchaseQuantityInput.value 값이 없을 수 있기 때문에(undefined) OR 연산자와 함께 값을 잘 초기화 하셨네�요👍
| purchaseQuantityInput.addEventListener('input', function () { | ||
| const count = parseInt(purchaseQuantityInput.value) || 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| purchaseQuantityInput.addEventListener('input', function () { | |
| const count = parseInt(purchaseQuantityInput.value) || 0; | |
| purchaseQuantityInput.addEventListener('input', function (event) { | |
| const count = parseInt(event.target.value); |
이런식으로 event 객체를 사용해서 값을 표현할 수 있습니다. 실제로 자주 사용하는 방식이기도 하고, 이벤트가 발생했을 때 값을 가져오기 때문에 더 의도에 맞게 표현할 수 있습니다.
| const resultTextDiv = document.createElement("div"); | ||
| resultTextDiv.className = "result-text-div"; | ||
|
|
||
| const matchCount = userNumbers.filter(num => correctNumbers.includes(num)).length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filter 고차함수 좋습니다. 고차함수는 선언적으로 프로그래밍 할 수 있고, 코드의 의도가 명확해서 정말 자주씁니다.
해치웠습니다..