ClearScript Library
ClearScript Library
ClearScript Library Reference
Microsoft.ClearScript.JavaScript
JavaScriptExtensions Class
JavaScriptExtensions Methods
ToAsyncEnumerable Method
ToEnumerable Method
ToPromise Method
ToTask Method

# JavaScriptExtensions Methods

The JavaScriptExtensions type exposes the following members.

Methods

| Name | Description
--- | --- | ---
| ToAsyncEnumerable | Supports managed asynchronous iteration over an async-iterable script object.
| ToEnumerable | Supports managed iteration over an iterable script object.
| ToPromise(Task) | Converts a Task instance to a promise for use with script code currently running on the calling thread.
| ToPromise(ValueTask) | Converts a ValueTask instance to a promise for use with script code currently running on the calling thread.
| ToPromise(Task, ScriptEngine) | Converts a Task instance to a promise for use with script code running in the specified script engine.
| ToPromise(ValueTask, ScriptEngine) | Converts a ValueTask instance to a promise for use with script code running in the specified script engine.
| ToPromiseT(TaskT) | Converts a TaskTResult instance to a promise for use with script code currently running on the calling thread.
| ToPromiseT(ValueTaskT) | Converts a ValueTaskTResult instance to a promise for use with script code currently running on the calling thread.
| ToPromiseT(TaskT, ScriptEngine) | Converts a TaskTResult instance to a promise for use with script code running in the specified script engine.
| ToPromiseT(ValueTaskT, ScriptEngine) | Converts a ValueTaskTResult instance to a promise for use with script code running in the specified script engine.
| ToTask | Converts a promise to a Task<Object> instance.

Top
See Also

#### Reference

JavaScriptExtensions Class
Microsoft.ClearScript.JavaScript Namespace

Copyright © Microsoft Corporation. All rights reserved.

Send comments on this topic to Microsoft