Module

x/lodash_es/src/clone.js>default

lodash for deno use
Latest
function default
import { default } from "https://dotland.deno.dev/x/lodash_es@v0.0.2/src/clone.js";

Creates a shallow clone of value.

Note: This method is loosely based on the structured clone algorithm and supports cloning arrays, array buffers, booleans, date objects, maps, numbers, Object objects, regexes, sets, strings, symbols, and typed arrays. The own enumerable properties of arguments objects are cloned as plain objects. An empty object is returned for uncloneable values such as error objects, functions, DOM nodes, and WeakMaps.

Examples

var objects = [{ 'a': 1 }, { 'b': 2 }];

var shallow = _.clone(objects); console.log(shallow[0] === objects[0]); // => true

Parameters

value

The value to clone.