-
Notifications
You must be signed in to change notification settings - Fork 59
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
[6팀 방재현] [Chapter 2-1] 클린코드와 리팩토링 #50
base: main
Are you sure you want to change the base?
Conversation
- 상품 리스트 (PRODUCT_LIST) 선언
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.
혹시 const와 let을 쓰지 않고 var을 그대로 남겨두신 이유가 있을까요~!
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.
수정을 못했네요..! var사용은 전역으로 사용하는 것 아니면 사용하지 말자! 가 목표였는데 수정을 못하고 함수만 분리했습니다..! 감사합니다:)
target.classList.contains("quantity-change") || | ||
target.classList.contains("remove-item") | ||
) { | ||
handleDeleteToCart(target); |
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.
handler 이전에 if 문으로 조건을 걸러내는 방법도 있네요ㅎㅎ,,👍🏻👍🏻
for (var j=0; j < prodList.length; j++) { | ||
if(prodList[j].id === cartItems[i].id) { | ||
curItem=prodList[j]; | ||
for (var j = 0; j < prodList.length; j++) { |
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.
const curItem = prodList.find(product => product.id === cartItems[i].id);
명령형 구조를 선언형 구조로 바꿔 보시면 깔끔하고 의도가 명확해질 것 같습니다!
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.
해당 파일은 테오의 코드입니다 :) 배열의 요소를 순회하는 코드는 forEach 같은 함수로 처리하는걸 목표로 하고 있지만 꽤나 쉽지 않은것 같아요 ㅠ for문에 익숙해져서요 ㅠ...! 의견 감사합니다 :)
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.
허걱 그렇네요 ㅠㅠㅠㅠ
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.
이렇게 함수로 빼서 element 생성하니까 넘 깔끔해보이네요! 🥹
과제 체크포인트
기본과제
심화과제
과제 셀프회고
과제에서 좋았던 부분
과제를 하면서 새롭게 알게된 점
과제를 진행하면서 아직 애매하게 잘 모르겠다 하는 점, 혹은 뭔가 잘 안되서 아쉬운 것들
리뷰 받고 싶은 내용이나 궁금한 것에 대한 질문