# new AsyncFunction(func) → {AsyncFunction}
AsyncFunction class
Parameters:
Name | Type | Description |
---|---|---|
func |
string | The function content that can later be executed |
Returns:
callable async function
- Type
- AsyncFunction
Example
let func = new AsyncFunction( 'console.log("it works!");' );
await func();
// evaluates the parameter string and creates an async function from it. Similar to eval(), but in a limited scope