πŸŽ„ Get 20% off from our JavaScript course for the holidays! πŸŽ„
Why Do We Get "undefined is not a function" in JavaScript?

Why Do We Get "undefined is not a function" in JavaScript?

Ferenc Almasi β€’ Last updated 2021 January 15 β€’ Read time 1 min read
  • twitter
  • facebook
JavaScript

The error speaks for itself. You want to execute a function. However, what you are trying to execute is evaluated to asΒ undefined. This will throw the following error as it’s basically the same as sayingΒ undefined(); And since undefined is a reserved keyword, it cannot be called as a function.

Typeerror logged to console
undefined
If you would like to see more Webtips, follow @flowforfrank

50 JavaScript Interview Questions

Resources:

Did you find this page helpful?
πŸ“š More Webtips
Frontend Course Dashboard
Master the Art of Frontend
  • check Access exclusive interactive lessons
  • check Unlimited access to hundreds of tutorials
  • check Remove ads to learn without distractions
Become a Pro

Recommended