Skip to content

Instantly share code, notes, and snippets.

@ferdiunal
Created September 4, 2016 16:59
Show Gist options
  • Save ferdiunal/6e041c32cce4a3e9a6ac2a41171a7455 to your computer and use it in GitHub Desktop.
Save ferdiunal/6e041c32cce4a3e9a6ac2a41171a7455 to your computer and use it in GitHub Desktop.
nestable: function (child, string = 0) {
var nested = [];
child.forEach(e => {
e["push"] = ' '.repeat(string)
this.parents.push(e);
if (e.child !== null) {
nested += this.nestable(e.child, string + 2);
}
});
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment