MCPcopy Create free account
hub / github.com/codecombat/codecombat / clone

Function clone

app/core/utils.js:70–77  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

68}
69
70const clone = function (obj) {
71 if ((obj === null) || (typeof (obj) !== 'object')) { return obj }
72 const temp = obj.constructor()
73 for (const key in obj) {
74 temp[key] = clone(obj[key])
75 }
76 return temp
77}
78
79const combineAncestralObject = function (obj, propertyName) {
80 const combined = {}

Callers

nothing calls this directly

Calls 1

constructorMethod · 0.45

Tested by

no test coverage detected