Skip to content

Instantly share code, notes, and snippets.

@hugozap
Created June 20, 2013 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hugozap/5826546 to your computer and use it in GitHub Desktop.
Save hugozap/5826546 to your computer and use it in GitHub Desktop.
var obj={
AccountId:"123",
otraProp:"222"
}
var obj2={
ACCOUNTID:"12223"
}
function CambiarPropiedadesAMayusc(obj){
for(var prop in obj){
var upperProp = prop.toUpperCase();
if(prop!=upperProp){
obj[upperProp] = obj[prop];
//delete obj[prop];
}
}
}
CambiarPropiedadesAMayusc(obj);
CambiarPropiedadesAMayusc(obj2);
console.log(JSON.stringify(obj));
console.log(JSON.stringify(obj2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment