I have this as data input (it's dynamic so it can be 1 up to 5 brackets in the same string)
data["optionBase"] = {} //declaration
data["optionBase"]["option"] = {} //declaration
data["optionBase"]["option"][value] = {} //declaration
data["optionBase"]["option"][value]["detail"] = somethingHere
Each line comes as a string, not as an array or any other type of javascript object. How can i get an array out of that string containing something like this:
Line 1:
result[0] = "optionBase"
Line 2:
result[0] = "optionBase"
result[1] = "option"
Line 3:
result[0] = "optionBase"
result[1] = "option"
result[2] = value
Line 4:
result[0] = "optionBase"
result[1] = "option"
result[2] = value
result[3] = "detail"