clone

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
1 KB
Creates a deep copy of the value which may contain (nested) `Array`s and `Object`s, `Number`s, `String`s, `Boolean`s and `Date`s.
1 contributor
Install clone as a package?
Copied
npm i @bit/justin-capalbo.ramda.clone
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
clone (
value:*
) : *

Creates a deep copy of the value which may contain (nested) Arrays and Objects, Numbers, Strings, Booleans and Dates. Functions are assigned by reference rather than copied

Dispatches to a clone method if present.

Example
const objects = [{}, {}, {}];
     const objectsClone = R.clone(objects);
     objects === objectsClone; //=> false
     objects[0] === objectsClone[0]; //=> false
Argument
value: *

The object or array to clone

Returns
*

A deeply cloned copy of `val`

Help and resources