From 4575279762bfdecd07f15c99f3624771545178ca Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Wed, 7 Aug 2024 11:50:03 +0900 Subject: [PATCH] Created GeneratorFunction (markdown) --- GeneratorFunction.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 GeneratorFunction.md diff --git a/GeneratorFunction.md b/GeneratorFunction.md new file mode 100644 index 0000000..342080e --- /dev/null +++ b/GeneratorFunction.md @@ -0,0 +1,12 @@ +## GeneratorFunction + +```js +var a = new GeneratorFunction(function(_yield) { + _yield("a"); + _yield("b"); + _yield("c"); +}); +console.log(a.next().value); +console.log(a.next().value); +console.log(a.next().value); +``` \ No newline at end of file