Created
December 30, 2015 07:11
-
-
Save sabrinaluo/9a794c5d62b00f3a47a2 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 copy(object) { | |
if (object === null || object === undefined) return object; | |
var dupe = {}; | |
// jshint forin:false | |
for (var key in object) { | |
dupe[key] = object[key]; | |
} | |
return dupe; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment