From 5d8c999227ea415d25043ec6d9dd442e16e6d3c8 Mon Sep 17 00:00:00 2001 From: hookim <81621620+hookim@users.noreply.github.com> Date: Thu, 13 Feb 2025 08:53:30 +0900 Subject: [PATCH 1/2] =?UTF-8?q?34=EC=9E=A5=20=EB=82=B4=EC=9A=A9=20?= =?UTF-8?q?=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\352\271\200\354\236\254\355\233\204.md" | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 "34\354\236\245 \354\235\264\355\204\260\353\237\254\353\270\224/\352\271\200\354\236\254\355\233\204.md" diff --git "a/34\354\236\245 \354\235\264\355\204\260\353\237\254\353\270\224/\352\271\200\354\236\254\355\233\204.md" "b/34\354\236\245 \354\235\264\355\204\260\353\237\254\353\270\224/\352\271\200\354\236\254\355\233\204.md" new file mode 100644 index 0000000..2447e34 --- /dev/null +++ "b/34\354\236\245 \354\235\264\355\204\260\353\237\254\353\270\224/\352\271\200\354\236\254\355\233\204.md" @@ -0,0 +1,5 @@ +- iterable은 순회를 하는 방법에 대한 통일된 프로토콜이다. 이 프로토콜로 통일된 방법으로 데이터를 순회할 수 있게 된다. +- iterable 프로토콜을 준수한다면 `for... of`, `...`(스프레드), `배열 디스트럭쳐링`을 사용할 수 있다. +- 객체의 `Symbol.iterator`프로퍼티가 있어야 이터러블을 사용할 수 있다. 해당 프로퍼티에는 iterator 객체가 존재한다. +- iterator는 순회 리스트의 아이템에 대한 포인터 역할을 한다. +- iterator 객체는 next 메소드를 갖고 이 메소드는 `{value : any , done : boolean}`을 리턴한다 From 8a3b3b058093df3ffcb5bd09eb0900fe3e4bb157 Mon Sep 17 00:00:00 2001 From: hookim <81621620+hookim@users.noreply.github.com> Date: Thu, 13 Feb 2025 08:57:03 +0900 Subject: [PATCH 2/2] =?UTF-8?q?Create=20=EA=B9=80=EC=9E=AC=ED=9B=84.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\352\271\200\354\236\254\355\233\204.md" | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 "35\354\236\245 \354\212\244\355\224\204\353\240\210\353\223\234 \353\254\270\353\262\225/\352\271\200\354\236\254\355\233\204.md" diff --git "a/35\354\236\245 \354\212\244\355\224\204\353\240\210\353\223\234 \353\254\270\353\262\225/\352\271\200\354\236\254\355\233\204.md" "b/35\354\236\245 \354\212\244\355\224\204\353\240\210\353\223\234 \353\254\270\353\262\225/\352\271\200\354\236\254\355\233\204.md" new file mode 100644 index 0000000..ab2cff6 --- /dev/null +++ "b/35\354\236\245 \354\212\244\355\224\204\353\240\210\353\223\234 \353\254\270\353\262\225/\352\271\200\354\236\254\355\233\204.md" @@ -0,0 +1,3 @@ +- 스프레드 문법은 값이 아님. 따라서 할당할 수 없다. +- ...Rest parameter와 반대방향. Rest parameter는 펼쳐진것을 묶어서 배열로 만들어주는 반면 스프레드 문법은 iterable 객체를 펼치는것! [1,2,3] -> 1, 2, 3 +- 객체 스프레드는 원래는 없었지만 새롭게 추가됐다고 한다.