mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-13 21:21:03 +00:00
Updated Functions (markdown)
parent
4b11a5b238
commit
cd2af846a4
15
Functions.md
15
Functions.md
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
## AsyncFunction
|
## 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
|
### Examples
|
||||||
|
|
||||||
|
@ -53,6 +53,19 @@ exports.onShoutcut = onShoutcut;
|
||||||
exports.sub_01 = sub_01;
|
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
|
## Contact me
|
||||||
- abuse@catswords.net
|
- abuse@catswords.net
|
||||||
- ActivityPub [@catswords_oss@catswords.social](https://catswords.social/@catswords_oss)
|
- ActivityPub [@catswords_oss@catswords.social](https://catswords.social/@catswords_oss)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user