From 32eab6062bffd2f0c6f4e818189d69f5d06fa228 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Fri, 25 Feb 2022 15:58:51 +0900 Subject: [PATCH] Created AsyncFunction (markdown) --- AsyncFunction.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 AsyncFunction.md 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(); +}); +```