toJS property

JSArray<JSString?> get toJS

Converts this to a JSArray of nullable JSStrings.

Note: Depending on whether code is compiled to JavaScript or Wasm, this conversion will have different semantics.

When compiling to JavaScript, the core List is a JavaScript Array, and therefore this getter simply casts. If the List is not a core List e.g. a user-defined list, this getter throws with a cast error.

When compiling to Wasm, this getter clones this List's values into a new JSArray.

Avoid assuming that modifications to this List will affect the returned JSArray and vice versa in all compilers.

Implementation

external JSArray<JSString?> get toJS;