Skip to content

Conversation

@gimadud
Copy link

@gimadud gimadud commented Apr 8, 2025

해치웠습니다..

Copy link
Contributor

@dooohun dooohun 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 +8 to +12
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
Copy link
Contributor

Choose a reason for hiding this comment

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

.vscode 에 다양한 설정을 할 수 있습니다! 개발자 경험(DX)을 향상시킬 때 큰 도움이 됩니다.
특히 협업 및 팀프로젝트를 진행할 때 모두 동일한 환경에서 개발을 할 수 있도록 도와줍니다.

다양한 시도는 언제나 좋습니다~👍

Comment on lines +8 to +9
let correctNumbers = [];
let userNumbersList = [];
Copy link
Contributor

Choose a reason for hiding this comment

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

객체 타입을 선언할 때 letconst의 차이점은 무엇일까요?
만약 const를 사용한다면 어떤 이점이 있을까요?

}

purchaseQuantityInput.addEventListener('input', function () {
const count = parseInt(purchaseQuantityInput.value) || 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

purchaseQuantityInput.value 값이 없을 수 있기 때문에(undefined) OR 연산자와 함께 값을 잘 초기화 하셨네�요👍

Comment on lines +37 to +38
purchaseQuantityInput.addEventListener('input', function () {
const count = parseInt(purchaseQuantityInput.value) || 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

filter 고차함수 좋습니다. 고차함수는 선언적으로 프로그래밍 할 수 있고, 코드의 의도가 명확해서 정말 자주씁니다.

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