next1 [JavaScript] Generator Function 이해하기 Generator Function GeneratorFunction GeneratorFunction 생성자는 새로운 generator function 객체를 생성한다. JavaScript 에서 모든 generator function 은 실제로 GeneratorFunction object 이다. developer.mozilla.org Generator Function을 처음 알게 된건, Redux-saga를 통해 알에 되었다 모양은 function* 이렇게 function 선언 다음에 * 가 붙은 모양이다. function* generatorTest() { yeild console.log(5); yeild console.log(10); } 일반 함수는 함수를 호출하면 Funtion안에 선언된 로직들이 일괄 .. 2020. 5. 25. 이전 1 다음