What would be the best way to clone an object? (I don't want to create a new reference to an object.)
The reason I want to do this is to clone Event objects so I can later reference them instead of the current one using timeouts.
I was thinking around the lines of this:
Code:function clone(o) { var clone = {}; for(var i in o) { clone[i] = o[i]; } return clone; }



Reply With Quote

Bookmarks