• Returns a deep copy of an object or array of any depth. Returns x unchanged if it's a JavaScript primitive.

    Type Parameters

    • T

    Parameters

    • x: T

    Returns T

    Example

    clone({ hello: 'world' });
    // => { hello: 'world' }

    clone('a simple string');
    // => 'a simple string'

    clone(null);
    // => null

Generated using TypeDoc