Skip to content

clone

Creates a shallow copy of the given object/value.

Usage

const original = { a: 1, b: { c: 3 } };
const cloned = clone(original); // => { a: 1, b: { c: 3 } }
original !== cloned; // => true
original.b === cloned.b; // => true

Installation

Terminal window
npx atmx add helper clone