📜 ⬆️ ⬇️

Eliminating the mysterious error "undefined is not a function" in V8

The javascript error " undefined is not a function " is quite mysterious. That is why explanatory articles, of which the reader, who begins to learn programming in JavaScript, is able to learn that such an error (an attempt to use an undefined value as a function) most often occurs when calling a non-existing object method (and such a call, in its queue, most often occurs in the case of typos in the name of the method). Such an explanatory article could be “ Errors in JavaScript and how to fix them ”, for example.

However, even after the clarification, the idea remains that the detection and elimination of typos (and other errors when calling methods) would be much easier if the name of the “guilty” method was contained directly in the text of the error that appeared.

So it happened:

However, the above-mentioned improvement in the error message occurred only in V8, that is, it will appear only in Google Chrome, in Chromium, in the new Opera, and over time in Node.js and in other node-like engines that serve to launch non-browser javascript . Nothing is known about the implementation of this improvement in other browsers.

')

Source: https://habr.com/ru/post/256079/


All Articles