[34~37장] 이터러블, 스프레드 문법, 디스트럭처링 할당, Set과 Map #57
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.
📌 변경된 내용
📌 본문
이터러블
이터러블의 경우 통일된 방식으로 순회할 수 있다는 점에서 그 유용함을 배워갔습니다. 매번 뭔가가 이터러블 하다고 했을 때 깊게 생각하지 않고 그냥 순회가능이구나라고 넘겼었지만 이번 기회에 소스코드 관점에서 iterable을 정의를 명확하게 배울 수 있었습니다.
스프레드 문법
스프레드 문법같은 경우에는 굉장히 자주 쓰는 문법이었습니다. 특히나 얕은 복사를 할때 많이 썼던 것 같습니다. 쓰면서 가끔 스프레드 문법이 배열, 객체를 리턴한다고 혼동한적이 많았는데 이번 장에서
스프레드는 값이 아니기 때문에 할당할 수 없다
는 명확한 문장을 보고 이제 혼동하지 않을 수 있을 것 같습니다.디스트럭처링 할당
디스트럭처링 할당. 디스트럭쳐링 할당도 코드가 깔끔해지기 때문에 굉장히 자주 사용하는 문법이었습니다. 다른이름으로 설정, 기본값 설정과 같은 추가 옵션들을 확인하면서 한번 더 복습을 하는 시간을 가졌습니다.
Set과 Map
Set과 Map은 가볍게 읽으면서 이런 자료구조를 제공한다는 것을 확인하고 넘어갔습니다.