🚴 JavaScript exercise for Sleep Number interviewees
Convert an array of Person objects into a tree of PersonTreeNode objects.
- Clone the repository
- Open
index.htmlin your browser - Open
js/Person.js,js/PersonTreeNode.js, andjs/answer.jsin your favorite editor - Add your code to the
generateTreefunction inanswer.js
- The exercise uses two JavaScript classes:
PesronandPersonTreeNode - The
generateTreefunction receives an array ofPersonobjects and should return the rootPersonTreeNode(CEO) - Each
PersonTreeNode'sdirectReportsarray should contain aPersonTreeNodefor each direct report of that person - The app will use your
generateTreefunction to evaluate the test - Refresh the page or click the button to re-run the test