Created
December 11, 2014 22:13
-
-
Save LiamKarlMitchell/0273348fdff4b1e82b18 to your computer and use it in GitHub Desktop.
Copies the keys from passed in object and returns a new object that references all the same kerys.
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 Clone(o) { | |
var n = {}; | |
for (var a in o) { | |
if (o.hasOwnProperty(a)) { | |
n[a] = o[a]; | |
} | |
} | |
return n; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment