Underscore.js _.clone() Function (original) (raw)
Last Updated : 28 Apr, 2025
Underscore.js**_.clone() function is used to create a shallow copy of the given object. The nested objects or arrays will be copied using reference, not duplicated.
**Syntax:
_.clone( object );
**Parameters:
- **object: It contains the value of the object that needs to be copied.
**Return Value:
It returns the shallow copy of the given object.
**Example 1: This example shows the use of the underscore.js _.clone() function.
html `