Demo entry 2826454

clone

   

Submitted by anonymous on Oct 07, 2015 at 08:52
Language: TypeScript. Code size: 199 Bytes.

    export function clone<T>(object: T): T {
        let result: any = {};
        for (let id in object) {
            result[id] = (<any>object)[id];
        }
        return <T>result;
    }

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).