What I have is an array like this: ['foo','bar'] and I want to turn it into an object that looks like this:
{
foo:{
bar:{
etc:{}
}
}
}
I've tried with two loops but I can get it to work if there is three values in the array.