Returns a non-deep copy of the provided value in the following way:
const a = [1, 2, 3];const b = clone(a);b[0] = 4;console.log(a); // [1, 2, 3]console.log(b); // [4, 2, 3] Copy
const a = [1, 2, 3];const b = clone(a);b[0] = 4;console.log(a); // [1, 2, 3]console.log(b); // [4, 2, 3]
The type of the value to be cloned.
The value to be cloned.
A non-deep copy of the provided value.
Returns a non-deep copy of the provided value in the following way:
Example