Function deepCopy

  • Copy/Clone Object deeply.

    Usage:

    const ret1 = deepCopy(['a', 'b', 'c']);
    const ret2 = deepCopy('abc');
    console.log(ret1);
    console.log(ret2);

    Output:

    ['a', 'b', 'c']
    abc
    

    Type Parameters

    • T

    Parameters

    • obj: T

      The value to clone.

    Returns T

    Returns the deep cloned value.