Created
June 20, 2013 20:55
-
-
Save hugozap/5826546 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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