Created
September 4, 2016 16:59
-
-
Save ferdiunal/6e041c32cce4a3e9a6ac2a41171a7455 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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