Question: what does undefined is not a function mean?
Answer: That expression can be complex. So when you see undefined is not a function it means that expression did not return a function object. So you have to figure out why what you are trying to execute isn't a function. And in this case, it was because you didn't put something where you thought you did.