Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 25th, 2013  |  syntax: JavaScript  |  size: 0.47 KB  |  views: 31  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data