Skip to content

cloning object  #1946

@dlaberge

Description

@dlaberge

I have documented the question more on Stack Overflow (http://stackoverflow.com/questions/28150967/typescript-cloning-object)

Is there a way to clone an object in typescript? Currently I'm using the following hack

var cloneObj = new this.constructor();

but typescript raises the following error : error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions