Skip to content

Instantly share code, notes, and snippets.

/*
https://www.youtube.com/watch?v=k7-N8R0-KY4&list=PL0zVEGEvSaeEd9hlmCXrk5yUyqUag-n84
@Gegeg
Could you do this with reduce?
*/
const categories = [
{ id: 'a', parent: '0'},
{ id: 'b', parent: '0'},
{ id: 'c', parent: 'a'},