I am trying to create an object with a value for the last key. I just have an Array with keys and value, but I donβt know how to create an object without using links in javascript.
As far as I know, there is no way to create a variable reference in javascript.
This is what I have:
var value = 'test'; var keys = ['this', 'is', 'a', 'test'];
This is what I want:
myObject: { this : { is: { a : { test : 'test' } } } }
Any idea how I can do this in the best way in JavaScript?
source share