title: Convert Array To Nested JSON in Javascript?
body: <p>Basically i want to create a tree structure. For example if you have an array of four items ['a', 'b', 'c', 'd'] then i need a JSON from this which should be </p>
  
  <pre><code>{a: {b: {c: {d: 0} } } }
  </code></pre>
  
  <p>last item of JSON have value of 0 or it can be anything except object.</p>