structuredClone function

dynamic structuredClone([
  1. dynamic value,
  2. StructuredSerializeOptions? options
])

Creates a deep copy of a given value using the structured clone algorithm.

Unlike a shallow copy, a deep copy does not hold the same references as the source object, meaning its properties can be changed without affecting the source. For more details, see MDN.

Throws a DataCloneError if any part of the input value is not serializable.

Implementation

_i2.dynamic structuredClone([
  _i2.dynamic value,
  _i3.StructuredSerializeOptions? options,
]) =>
    _i4.callMethod(
      _self,
      'structuredClone',
      [
        value,
        options ?? _i6.undefined,
      ],
    );