Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var linked_tree = [{
- id: '1-abc'
- value: '...'
- }, {
- id: '2-abc',
- parent: '1-abc',
- value: '...'
- }, {
- id: '2-def',
- parent: '1-abc',
- value: '...'
- }, {
- id: '3-abc',
- parent: '2-abc',
- value: '...'
- }];
- // Convert to
- var linked_tree = [{
- id: '1-abc'
- value: '...',
- nodes: [{
- id: '2-abc',
- parent: '1-abc',
- value: '...'
- }, {
- id: '2-def',
- parent: '1-abc',
- value: '...',
- nodes: [{
- id: '3-abc',
- parent: '2-abc',
- value: '...'
- }]
- }
- }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement