diff --git a/Functions.md b/Functions.md index cd9b01a..9a66a6f 100644 --- a/Functions.md +++ b/Functions.md @@ -2,7 +2,7 @@ ## AsyncFunction -JScript does not support the `async` keyword. So, WelsonJS uses the `AsyncFunction` class made by itself. +JScript does not support the `async` and `Generator` keywords. So, WelsonJS uses the `AsyncFunction`, `GeneratorFunction` class made by itself. ### Examples @@ -53,6 +53,19 @@ exports.onShoutcut = onShoutcut; exports.sub_01 = sub_01; ``` +## 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); +``` + ## Contact me - abuse@catswords.net - ActivityPub [@catswords_oss@catswords.social](https://catswords.social/@catswords_oss)