Options
All
  • Public
  • Public/Protected
  • All
Menu

Module clone

Index

References

Functions

References

Renames and re-exports clone

Functions

  • clone<T>(x: T): T
  • Creates a deep copy of the value which may contain (nested) Arrays and Objects, Numbers, Strings, Booleans and Dates. Functions are not copied, but assigned by their reference.

    example
     var objects = [{}, {}, {}];
    var objectsClone = clone(objects);
    objects[0] === objectsClone[0]; //=> false

    Type parameters

    • T

    Parameters

    • x: T

      The value to clone

    Returns T

    A copy of a value.

Generated using TypeDoc