Renaming object keys recursively
There are a couple of problems there. One is that you’re falling prey to The Horror of Implicit Globals by failing to declare your build variable in the function. But the logic has issues as well, here’s a minimal reworking: var keys_short = [“ch”,”d”,”u”,”tz”]; var keys_long = [“children”,”data”,”user_id”,”time_zone”]; function refit_keys(o){ var build, key, destKey, ix, … Read more