Current location - Education and Training Encyclopedia - Education and training - Beida Jade Bird Design Training: Eight Common Programming Errors of JavaScript?
Beida Jade Bird Design Training: Eight Common Programming Errors of JavaScript?
JavaScript programming language can be said to be a programming language that most programmers need to master. Today, let's take a look at the common mistakes when programming with JavaScript.

1.uncaughttypeerror: cannotreadproperty If you are a JavaScript developer, you may see this error more times than you dare to admit it (LOL? )。

This error will appear in Chrome when you read the property of an undefined object or call its method.

You can easily test it in the Chrome developer console.

2. TypeError: "undefined" is notanobject. This is an error when reading properties or calling methods on undefined objects in Safari.

You can easily test it in SafariDeveloperConsole.

This is basically the same as the Chrome error mentioned in 1, except that Safari uses a different error message prompt.

3.TypeError: nullsnotanObject This is an error when reading a property or calling a method on an empty object in Safari.

You can easily test it in SafariDeveloperConsole.

4. (Unknown): script errors When uncaught JavaScript errors (errors caused by the window.onerror handler but not caught in the try-catch) are restricted by the browser's cross-domain policy, such script errors will occur.

5. Type error: object not support property This is an error when calling an undefined method in IE.

You can test it on the IE developer console.

6. TypeError: "undefined" is not a function. When you call an undefined function, it is an error generated in Chrome.

Jiayin computer training/thinks it can be tested on Chrome developer console and MozillaFirefox developer console.

7. Range error not captured: Maximum call stack This is a mistake that Chrome will make in some cases.

One is when you call a recursive function without termination.

You can test it in the Chrome developer console.