Let's say you need to make a 3-level menu for the store.
Tell me how to make an array of items and sub-items of the 3-level menu?
something like:
var catalog = [ {id: 0, title: 'item1', parent_id: 0}, {id 1, title: 'item2', parent_id: 0}, {id 2, title: 'item3', parent_id: 1}, {id 3, title: 'item4', parent_id: 1}, ... ] Tell me how to create a menu from this array, i.e. in the loop, you need to loop through this array, and form li, with text from the array.