Advertisement
Guest User

Untitled

a guest
Jan 25th, 2013
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // http://stackoverflow.com/a/10196772/173630
  2. function allKeysToLowerCase(obj) {
  3.     var output = {};
  4.     for (i in obj) {
  5.         if (Object.prototype.toString.apply(obj[i]) === '[object Object]'
  6.             || Object.prototype.toString.apply(obj[i]) === '[object Array]'
  7.         ) {
  8.             output[i.toLowerCase()] = allKeysToLowerCase(obj[i]);
  9.         } else {
  10.             output[i.toLowerCase()] = obj[i];
  11.         }  
  12.     }          
  13.     return output;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement