I am checking the attributes in a JavaScript object, replacing some of the keys by deleting the prefix \"element\" and saving the new values in another object.
key is not original json because you have remove element_ prefix
key
json
element_
var keys = Object.keys(json); for (var j=0; j < keys.length; j++) { key = keys[j].replace("element_", ""); var _key = keys[j]; switch(key) { default : tmp[key] = json[_key]; break; } }