I have an object, and I’d like to get each “branch” of the “tree” as an array. (Feel free to correct my terminology also!) What I have is like the following:
var features = {
"f": {
"t": "100",
"f": {
"i": ['150'],
"b": ['300'],
"f": {
"k": 100
}
},
"l": ['255']
},
"c": {
"s": {
"t": ["100"]
},
"t": "100"
}
};
And I’d like to parse it into the following result, so I can iterate over it again and pass it into another function.
var result = [
"ffi",
"fffk",
"fl",
"ct"
]
What I have so far is on JS Bin here. Any help or pointers in the right direction would be greatly appreciated! Thanks!