• Deep clones an array of instances of type T and returns a new array.

    Parameters

    • array: any[]

      The array to deep clone

    Returns any[]

    A new deep clone of the array argument

    Note that all the instances being cloned must implement this type of constructor:

    constructor(obj: any) {
    Object.assign(this, obj);
    

    Example

    <pre>
    const original = [new Todo(), new Todo()];
    const result = [new Todo(), new Todo()];
    expect(deepClone(original)).to.eql(result);
    </pre>

Generated using TypeDoc