Mark As Completed Discussion

Next up, let's implement add.

Step Four

A word is passed into the method (let's say "cat"), and begins to get processed. We'll first want to have references to the head node so that we can include each letter in cat as its eventual children and grandchildren. Here's how we accomplish establishing this lineage:

1let currentNode = this.head,
2  newNode = null,
3  currentChar = val.slice(0, 1);
4
5// val is used to keep track of the remaining letters
6val = val.slice(1);