deep clone with properties

function deepClone(obj) {
    let copy = {};

    if (null == obj || "object" != typeof obj) return obj;

    copy  = Object.create(obj.constructor.prototype)
    for (let key in obj){
        copy[key] = clone(obj[key])
    }
    return copy
}
by Luka Tatarishvili
4 years ago
JavaScript
Objects tutorial 6
0
Pro tip: use ```triple backticks around text``` to write in code fences