How to create a javascript object nested from a literal array?
I have the following array:
var x = ['a','b','c'];
From the array 'x' I would like to generate the following object:
var y = {a:{b:{c:{}}}};
So far I've tried iterating inside a loop. But I can not find a way to validate whether the result already exists or not, nor put in the correct position, a key within another.