How js traverses an array of arbitrary levels at any depth and converts it into html fragments

as the title

the real scene is that the chain store data of any depth and level given by the backend needs to be displayed on the page in the structure of a tree

related codes

let obj = {
  rst: "1",
  branch: [
    {
      rst: "2-1",
      branch: [
        {
          rst: "3-1",
          branch: [...]
        }
      ]
    },
    {
      rst: "2-2",
      brabch: [...]
    }
  ]
},
html;


const whatFunc = () = > {...};

expect results

whatFunc (); / / html assembly completed

Nov.11,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3e789-2c422.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3e789-2c422.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?