Trie

// Create a new trie
var tr = Trie()

var list = ["the", "a", "there", "answer", "any","by", "bye", "their"]
list.forEach(word => {
    tr.insertWord(word) // insert each element into the trie
})

console.log(tr.search("these")) // Returns true if the word is found, else false