I am following the example from this link Build tree array from JSON in JavaScript to generate my desired tree output. What I wanted to do was to make the "name" property value as the property name itself and remove the code property from the result. I tried to play with it but I have a little knowledge on how it works.
Codepen Link: json tree
Here is my desired result:
[
{
"one": "default value",
"children": [
{
"one one": "default value"
},
{
"one two": "default value"
}
]
},
{
"two": "default value"
},
{
"three": "default value"
}
]