title: Deep changing values in a JavaScript object
body: <p>I have an object which contains an unknown number of other objects. Each (sub-)object may contain boolean values as strings and I want to change them to real boolean values. Here's an example object:</p>
  
  <pre><code>var myObj = {
    my1stLevelKey1: "true",
    my1stLevelKey2: "a normal string",
    my1stLevelKey3: {
      my2ndLevelKey1: {
        my3rdLevelKey1: {
          my4thLevelKey1: "true",
          my4thLevelKey2: "false"
        }
      },
      my2ndLevelKey2: {
        my3rdLevelKey2: "FALSE"
      }
    }
  }
  </code></pre>
  
  <p>What I want in the end is this:</p>
  
  <pre><code>var myObj = {
    my1stLevelKey1: true,
    my1stLevelKey2: "a normal string",
    my1stLevelKey3: {
      my2ndLevelKey1: {
        my3rdLevelKey1: {
          my4thLevelKey1: true,
          my4thLevelKey2: false
        }
      },
      my2ndLevelKey2: {
        my3rdLevelKey2: false
      }
    }
  }
  </code></pre>
  
  <p>Important is that the number sub-objects/levels is unknown. How can I do this effectively by either using classic JavaScript or Mootools?</p>