Underscore.js _.clone() Function (original) (raw)

Last Updated : 25 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:

**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

**Output:

**Example 2: This example shows the use of the underscore.js _.clone() function.

html

**Output:

Similar Reads