Skip to content

Instantly share code, notes, and snippets.

@m-yahya
Created April 28, 2021 15:21
Show Gist options
  • Save m-yahya/bd9250f7f6a9bff79f9f67348ac00178 to your computer and use it in GitHub Desktop.
Save m-yahya/bd9250f7f6a9bff79f9f67348ac00178 to your computer and use it in GitHub Desktop.
Tutorial: Nested UI from JSON data and Tree view
// get items in the object
const getItems = (items) => {
for (const item in items) {
markupArray.push(`<li> ${item}`);
// fetch the parent object
let details = items[item];
getDetails(details);
// push the closing tag for parent
markupArray.push("</li>");
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment