Open
Conversation
added 12 commits
March 24, 2025 01:19
dooohun
reviewed
Apr 9, 2025
Contributor
dooohun
left a comment
There was a problem hiding this comment.
수고하셨습니다!
코드 리뷰 남긴 거 확인해주고 답변 꼭 달아주세요~
Comment on lines
+8
to
+12
| "type": "chrome", | ||
| "request": "launch", | ||
| "name": "Launch Chrome against localhost", | ||
| "url": "http://localhost:8080", | ||
| "webRoot": "${workspaceFolder}" |
Contributor
There was a problem hiding this comment.
.vscode 에 다양한 설정을 할 수 있습니다! 개발자 경험(DX)을 향상시킬 때 큰 도움이 됩니다.
특히 협업 및 팀프로젝트를 진행할 때 모두 동일한 환경에서 개발을 할 수 있도록 도와줍니다.
다양한 시도는 언제나 좋습니다~👍
Comment on lines
+8
to
+9
| let correctNumbers = []; | ||
| let userNumbersList = []; |
Contributor
There was a problem hiding this comment.
객체 타입을 선언할 때 let과 const의 차이점은 무엇일까요?
만약 const를 사용한다면 어떤 이점이 있을까요?
| } | ||
|
|
||
| purchaseQuantityInput.addEventListener('input', function () { | ||
| const count = parseInt(purchaseQuantityInput.value) || 0; |
Contributor
There was a problem hiding this comment.
purchaseQuantityInput.value 값이 없을 수 있기 때문에(undefined) OR 연산자와 함께 값을 잘 초기화 하셨네�요👍
Comment on lines
+37
to
+38
| purchaseQuantityInput.addEventListener('input', function () { | ||
| const count = parseInt(purchaseQuantityInput.value) || 0; |
Contributor
There was a problem hiding this comment.
Suggested change
| 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; |
Contributor
There was a problem hiding this comment.
filter 고차함수 좋습니다. 고차함수는 선언적으로 프로그래밍 할 수 있고, 코드의 의도가 명확해서 정말 자주씁니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
해치웠습니다..