description

# toJS property

JSUint8Array get toJS

Converts this Uint8List to a JSUint8Array by either casting, unwrapping, or cloning the Uint8List.

Note

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

When compiling to JavaScript, all typed lists are the equivalent JavaScript typed arrays, and therefore this getter simply casts.

When compiling to Wasm, this Uint8List is a wrapper around a `Uint8Array` if it was converted via JSUint8ArrayToUint8List.toDart. If it is a wrapper, this getter unwraps it and returns the `Uint8Array`. If it's instantiated in Dart, this getter clones this Uint8List's values into a new JSUint8Array.

Avoid assuming that modifications to this Uint8List will affect the returned JSUint8Array and vice versa on all compilers unless it was converted first via JSUint8ArrayToUint8List.toDart.

## Implementation

    external JSUint8Array get toJS;