title: Convert array into nested object
body: <p>Let's say I have the following array:
  ['product' , 'model', 'version']</p>
  
  <p>And I would like to have an object such as:</p>
  
  <pre><code>{
      product: { 
          model: { 
              version: { 
  
              }
          }
       }
  }
  </code></pre>
  
  <p>However, that array is dynamic so it could have 2, 3 or fewer more items.
  How can this be achieved in the most efficient way?</p>
  
  <p>Thanks</p>