I have an array of name / value objects (below). Names are formatted to represent a multidimensional array.
I need to build a complete JavaScript object from it (bottom).
[{ name: "getQuote[origin]", value: "Omaha,NE" }, { name: "getQuote[destination]", value: "10005" }, { name: "getQuote[country]", value: "us" }, { name: "getQuote[vehicles][0][year]", value: "1989" }, { name: "getQuote[vehicles][0][make]", value: "Daihatsu" }, { name: "getQuote[vehicles][0][model]", value: "Charade" }, { name: "getQuote[vehicles][0][count]", value: "1" }]
In something like this:
{getQuote : { origin : Omaha}, { destination : 10005}, {vehicles : [ { year : 1989, make: Honda, model : accord }, {
n
source share