[박운성] week5#217
Open
Useong0 wants to merge 4 commits intocodeit-bootcamp-frontend:part1-박운성from
Hidden character warning
The head ref may contain hidden characters: "part1-\ubc15\uc6b4\uc131-week5"
Open
Conversation
| } else { | ||
| if(emailInput.parentElement.querySelector('.error')) { | ||
| emailInput.classList.remove('error'); | ||
| emailInput.parentElement.lastElementChild.remove(); |
Collaborator
There was a problem hiding this comment.
parentElement, lastElementChild 이런 종류의 property는 html 구조에 의존하게 됩니다. 즉, 추가적인 요구사항에 따라 구조가 바뀌게 되는 경우 해당 코드를 다시 수정해야하는 번거로움이 생기죠.
해당 태그를 한번에 찾아갈 수 있게 적절히 class, id를 부여해서 직접 접근하는 방법으로 사용해주세요.
| } | ||
| } | ||
|
|
||
| const eyeEvent = function (eyes) { |
Collaborator
There was a problem hiding this comment.
함수명은 setEyeEvent 가 자연스럽네요.
| }; | ||
|
|
||
| if (isTestUser) { | ||
| fetch('https://bootcamp-api.codeit.kr/api/sign-in', { |
Collaborator
There was a problem hiding this comment.
then / catchcallback 형식으로 처리한다고하면 마지막 then() 끝에 catch()까지 체이닝해주셔야 예외처리가 가능합니다.
차라리 async/await 패턴으로 바꾸셔서 try/catch로 적용해보시는 것이 요즘 트렌드긴 합니다.
Useong0
commented
Dec 26, 2023
Comment on lines
+4
to
+6
| const eyeClass = e.target.parentElement.classList; | ||
| const pwdText = e.target.parentElement.parentElement.firstElementChild; | ||
| console.log('o'); |
Collaborator
Author
There was a problem hiding this comment.
너무 parentElement랑 elementChild 종류를 많이 쓰는 것 같습니다.
console.log('o'); 코드가 꼭 필요한 게 아니면 지우는 게 좋을 것 같습니다
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.
요구사항
기본
심화
주요 변경사항
멘토에게