What's causing 'typeerror: x is not a function' in javascript?

This error means that you are trying to invoke something that isn't a function.

Example:


let notAFunction = 'Hello';
notAFunction();

Solution:


let actualFunction = () => console.log('Hello');
actualFunction();
Ensure that the variable or property you're trying to invoke is indeed a function.

Beginner's Guide to JavaScript