Last active
November 25, 2019 23:59
-
-
Save Jagathishrex/ba23b837ff09ef78f3be40ed9b443609 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 copy(sourceObj) { | |
| let targetObj = {}; | |
| let keys = Object.keys(sourceObj); | |
| for (let i = 0, len = keys.length; i < len; i++) { | |
| let key = keys[i]; | |
| targetObj[key] = sourceObj[key]; | |
| } | |
| return targetObj; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment