The value to be cloned.
Optional
transferUnclonables: booleanA flag indicating whether to transfer unclonable values as is. If false, the function will throw an error when encountering an unclonable value.
The cloned value.
Throws an error if the function encounters a non-plain object and transferUnclonables
is false.
This function is used to create a deep clone of plain values. It can handle arrays, plain objects, and primitives. For non-plain objects, it either transfers them as is or throws an error, based on the
transferUnclonables
flag.