title: Javascript: turn an array of keys into an empty object?
body: <p>I know this is probably easier than my brain is making it, but for some reason, I can't get this right:</p>
  
  <p>I have an array looks like this:</p>
  
  <pre><code>["engine", "engine.car", "engine.car.driver", 
   "engine.car.passenger", "wheels", "wheels.tires"]
  </code></pre>
  
  <p>I want to transform above array into this object:</p>
  
  <pre><code>{
      engine : {
          car : {
              driver : undefined,
              passenger: undefined
          }
      },
      wheels : {
          tires: undefined
      }
   }
  </code></pre>
  
  <p>I'm using node 8.10.0.</p>