Skip to content

Instantly share code, notes, and snippets.

@muhsalaa
Last active March 5, 2021 11:58
Show Gist options
  • Save muhsalaa/5199c3025e40dff4aa45219a58c0cf40 to your computer and use it in GitHub Desktop.
Save muhsalaa/5199c3025e40dff4aa45219a58c0cf40 to your computer and use it in GitHub Desktop.
// ref https://codepen.io/Pestov/pen/BLpgm
const tree = {
root: {
root1: { name: "Kakek", deceased: true },
root2: { name: "Nenek", deceased: false },
childs: [
{
name: "Anak 1",
spouse: [{ name: "Istri anak 1", deceased: false, divorced: true }],
deceased: false,
childs: [
{
name: "Cucu 1",
spouse: [{ name: "Suami cucu 1", deceased: false, divorced: false }],
deceased: false,
childs: [
{
name: "Cicit 1",
spouse: null,
deceased: false,
childs: []
}
]
}
]
}
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment