Skip to content
Tania Shatilova edited this page Nov 10, 2015 · 1 revision

The clone() method returns a clone of the object (only data fields, not function).

Syntax

var obj = {a: 1};
var clone = Mint.utils.clone(obj);

Return Value

object that is clone of the passed object.

Examples

var value = { a: { b: 1 } };
var clone = Mint.utils.clone(); // { a: { b: 1 } }

value = { 
            a: { 
                b: 1, 
                foo: function(){}
            },
            c: "lorem"
        };

clone = Mint.utils.clone();     // { a: { b: 1 }, c: "lorem" }

value = "Lorem";
clone = Mint.utils.clone();     // "Lorem"

Clone this wiki locally