getAllWords(prefix = '', node = this) {
    let words = [];

    if (!node) { return words; }
    if (node.isWord) {
      words.push(prefix);
    }

    for (const char of Object.keys(node.children)) {
      const newWords = this.getAllWords(`${prefix}${char}`, node.children[char]);
      words = words.concat(newWords);
    }

    return words;
  }
Returns all the words from the current `node`.
Uses backtracking.

@param {string} prefix - The prefix to append to each word.
@param {string} node - Current node to start backtracking.