Last active
January 27, 2022 08:42
-
-
Save sysoev-dev/c90a1dab02968f3ce903551331961d40 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function clone(object) { | |
let newObject = {} | |
for (let prop in object) { | |
newObject[prop] = (typeof object[prop] !== 'object') ? object[prop] : clone(object[prop]) | |
} | |
return newObject; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment