Merged
Conversation
* 스켈레톤 코드 작성 * 수많은 에러가 담긴 todo객체의 add함수 추가(id의 값을 제대로 가지지 못함, todo객체의 getStatusNum수정 필요 * 랜덤한 id값을 못가져오는 것을 수정. checkOverlap함수를 통해서 id의 값이 같지않도록 구현 * todo.add함수기능 완벽하게 구현 * todo.update함수 완성 * id를 입력받아 할일을 제거해주는 todo.remove함수 완성, 오류가많은 todo.printTask함수 완성 * todo.printTask함수 완성, tag를 확인하는 함수 제거(printTask를 통해 각 할일들의 태그가 무엇인지 확인이 가능하므로) * todo.printTagRelate 함수 완성, todo.add함수에서 버그를 발견함 * 새로운 객체 안 배열에 저장하도록 만들어 문제 해결 * remove함수를 호출했을때, saveData.task배열에서 지워지는것 뿐 아니라 saveData.idArrays배열에서도 id를 지워지게 수정 * 테스트코드를 주석처리함 들여쓰기를 다시 맞춤 * saveData객체를 없애고 그 내용을 todo객체 안으로 집어 넣음, todo.idArrays의 값은 todo.add를 호출할때마다 추가되도록 수정. * if(saveData.idArrays.indexOf(ranNum) !== -1)-> if(this.idArrays.includes(ranNum))으로 변경 * 기나긴 삼항연산자 statusNum[obj.status]++로 해결 * todo.update함수에서 바뀐 상태의 상태를 반영하지 않는 버그를 찾아내서 수정 * 함수마다 간단한 주석을 달아줌
… 인자로 입력받아 경과된 시간을 반환해주는 getTakeTime 함수 구현
…meData추가. 이를 이용해 updateDoingTime메서드 완성
…받아 같은인자와 tag를 출력, showTag메서드는 그 값을 세번 불러서 서로다른 3가지의 status값을 모두 출력.
…정(상태가done이면 doing항목을 출력하라고 입력했을때 done항목도 같이 출력되었었음)
…고, 배열의 값을 통해 같은 값을 출력하는 함수를 만듬
crongro
approved these changes
Oct 10, 2018
Contributor
crongro
left a comment
There was a problem hiding this comment.
잘 구현하셨네요.
리뷰 참고해서 다음단계 개발 진행해보세요.
다음단계에서는 객체를 추가로 구현하셔야 합니다.
또는 현재까지의 코드를, 객체단위로 별도로 분리하고 싶다면, 분리하고 다음단계 가도 좋고요.
기능완성도를 확인하기 위해서 동료에게 테스트를 부탁해보시고요.
| const todo = { | ||
| task: [], | ||
|
|
||
| add: function (objToAdd) { |
Contributor
There was a problem hiding this comment.
add(objTodAdd) { ..}
이렇게 간단하게 표현가능합니다.
| },//중복되지 않는 랜덤한 숫자를뽑아내는 함수 | ||
|
|
||
| getStatusNum: function (accumulatedTask) { | ||
| const statusNum = { |
Contributor
There was a problem hiding this comment.
여러메서드에서 사용하는 것이면 this.statusNum = {}
해도 될 거 같아요.
| updateTakeTime: function (objToUpdate) { | ||
| this.task.forEach(taskObj => { | ||
| if (taskObj.id === objToUpdate.id) { | ||
| taskObj.timeData = this.getTakeTime(taskObj.timeData, Date.now()) |
Contributor
There was a problem hiding this comment.
네 시간값은 각 task 객체 표현하는 게 좋은거 같네요.
| return sameTagNum | ||
| },//같은 태그의 개수를 세어주는 함수 | ||
|
|
||
| showAll: function () { |
Contributor
There was a problem hiding this comment.
잘 했습니다.
이렇게 구현하는 게 맞고요.
일정하지는 않지만 중복호출이니, 아래 부분을 재귀적으로 한번 바꿔보세요
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.
피드백에 의한 수정
step2 구현맥락
노력한점
많은 피드백은 항상 감사드립니다!!