function copy(obj)
{
var newObj = new Object();
for(var e in obj)
newObj[e] = obj[e];
return newObj;
}
It's also important to point out that this will do a "shallow" copy --
only top-level objects will get copied (so substructures might not get
cloned, but instead still reference inputs). A better implementation
would check each item to see if it's an object or array, and if so,
recursively copy those too.
(sorry for the limitation)
--
[ christopher wright ]
[email protected]
http://kineme.net/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [email protected]