Clone a javascript object and iterate through keys and values with a replacer method.
var obj = {name: 'John', surname: 'Appleseed', job: {title: 'Web Developer', company: 'Apple Inc'}};
function replacer(key, value) {
if (key === 'name') { return value.toLowerCase(); }
}
with cloneObj.js
var copy = clone(obj, replacer);
###update###
For built-in scheme use JSON.stringify(obj, replacer)
instead cloneObj.js
var copy = JSON.stringify(obj, replacer);
copy = JSON.parse(copy);