title: how to convert this nested object into a flat object?
body: <p>Sorry I don't know how to phrase the question title. Please help edit if possible.</p>
  
  <p>I have an object like this:</p>
  
  <pre><code>{
      a: 'jack',
      b: {
          c: 'sparrow',
          d: {
             e: 'hahaha'
          }
      }
  }
  </code></pre>
  
  <p>I want to make it look like:</p>
  
  <pre><code>{
      'a': 'jack',
      'b.c': 'sparrow',
      'b.d.e': 'hahaha'
  }
  
  // so that I can use it this way:
  a['b.d.e']
  </code></pre>
  
  <p>jQuery is ok too. I know for the nested object, I can use <code>a.b.d.e</code> to get <code>hahaha</code>, but today I have to use it like <code>a['b.d.e']</code> -_-!!!
  How can I achieve this? Thanks in advance :)</p>