"X is not a function" in JavaScript — What It Means and How to Fix It

What the JavaScript error "X is not a function" means and how to fix it.

Published October 29, 2026

"X is not a function" is occurs when code tries to call something that isn't actually a function.

Key points

  • Check the browser console's stack trace to find exactly which line and call triggered the error

Example

const x = 5;
x()  // TypeError: x is not a function
More JavaScript articles