Open
Conversation
Contributor
|
SymbolTable을 배열로 구현할 때, delete 메서드에서 뒤의 값을 앞으로 당겨오는 과정에서 #keys, #values 배열은 메모리 상에는 값이 남아있다가 이후 put이 호출됐을 때 덮어씌워지는건가요 ?? 네 맞습니다. 뒤에 값을 당겨오고, 남아있는 값들을 지우지는 않습니다. 만약 남아있는 값들이 특정 객체의 참조값이라면 지우는게 맞습니다. |
Contributor
|
problem-3/SymbolTable.js에 put 메서드를 구현할 때, 값만 변경하는 경우에는 조건문에서 바로 return 처리를 해도 괜찮은지 궁금합니다. 이미 해당하는 키가 존재해서 값을 수정만하고 빠르게 종료하고 있습니다. 이미 존재하면 아래 코드는 실행될 필요가 없다고 의도를 드러낼려고 이렇게 구현했어요 |
Author
예시 코드에서는 종료 처리를 안해주고 있어서 아래 코드가 실행될것 같은데, 혹시 좀 더 자세히 설명해주실 수 있을까요 ?? |
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.
작업내용
이번 주에는 강의를 보고 지난주에 비해 상대적으로 시간이 부족하여 풀이를 보면서 새로운 지식을 습득하는 데 집중했습니다.
알파벳도 부등호로 비교가 가능한 점을 알게 되어 흥미로웠습니다!
궁금한 점
SymbolTable을 배열로 구현할 때, delete 메서드에서 뒤의 값을 앞으로 당겨오는 과정에서#keys, #values배열은 메모리 상에는 값이 남아있다가 이후put이 호출됐을 때 덮어씌워지는건가요 ??problem-3/SymbolTable.js에 put 메서드를 구현할 때, 값만 변경하는 경우에는 조건문에서 바로 return 처리를 해도 괜찮은지 궁금합니다.