function copySelf(obj) {
var newobj = obj.constructor === Array ? [] : {};
if (typeof obj !== "object") {
return;
}
for (var i in obj) {
newobj[i] = typeof obj[i] === "object" ? copySelf(obj[i]) : obj[i];
}
return newobj;
}