* Generator: ํจ์์ ์คํ์ ์ค๊ฐ์ ๋ฉ์ท๋ค๊ฐ ์ฌ๊ฐํ ์ ์๋ ๊ธฐ๋ฅ. function ์์ *์ ์ฐ๊ณ ๋ด๋ถ์ yield ํค์๋ ์ฌ์ฉํ๋๋ฐ yield ์์ ํจ์ ์คํ์ ๋ฉ์ถ ์ ์์. Generator ํจ์๋ฅผ ์คํํ๋ฉด generator์ ๊ฐ์ฒด๊ฐ ๋ฐํ๋จ. ์ ๋๋ ์ดํฐ๋ ๋ค๋ฅธ ์์ ํ๋ค๊ฐ ๋ค์ ๋์์์ next() ํด์ฃผ๋ฉด ์งํ์ด ๋ฉ์ท๋ ๋ถ๋ถ๋ถํฐ ์ด์ด์ ์คํ - generator ๊ฐ์ฒด๋ next(), return(), throw() ๋ฉ์๋๋ฅผ ๊ฐ์ง๊ณ ์์ * next๋ฅผ ํธ์ถํ๋ฉด ๊ฐ์ฅ ๊ฐ๊น์ด yield 1์ ๋ง๋ ๋ ๊น์ง ์คํ๋๊ณ ๋ฐ์ดํฐ ๊ฐ์ฒด ๋ฐํ. function* fn(){ console.log(1); yield 1; console.log(2); yield 2; console.log(3); console.l..