diff --git a/AsyncFunction.md b/AsyncFunction.md new file mode 100644 index 0000000..fca7664 --- /dev/null +++ b/AsyncFunction.md @@ -0,0 +1,15 @@ +## AsyncFunction + +JScript does not support the `async` keyword. So, Wilson JS uses the `AsyncFunction` class made by itself. + +### Examples + +```js +var STD = require("lib/std"); + +[5, 4, 3, 2, 1].forEach(function(x) { + new AsyncFunction(function() { + sleep(x * 1000); + }).run(); +}); +```