Created
December 30, 2021 09:50
-
-
Save Vitaleks-project/77fa33d0ea295440f29c1a7148e35c20 to your computer and use it in GitHub Desktop.
Example2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Build folders tree. | |
// Example how should result looks like | |
// folderTree = { | |
// folders: [{ | |
// folders: [{ | |
// id, | |
// name, | |
// folders: [] | |
// }] | |
// }] | |
// }; | |
const folders = [ | |
{ id: 1, parent: null, name: 'Main videos' }, | |
{ id: 2, parent: 1, name: 'Kitchen videos' }, | |
{ id: 3, parent: 1, name: 'Garden videos' }, | |
{ id: 4, parent: 3, name: 'Garden videos1' }, | |
{ id: 5, parent: 3, name: 'Garden videos2' }, | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment