Skip to content

Instantly share code, notes, and snippets.

@sabrinaluo
Created December 30, 2015 07:11
Show Gist options
  • Save sabrinaluo/9a794c5d62b00f3a47a2 to your computer and use it in GitHub Desktop.
Save sabrinaluo/9a794c5d62b00f3a47a2 to your computer and use it in GitHub Desktop.
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