Code errors are a common occurrence, and we need to determine what causes them and how to avoid them.

1. Uncaught TypeError: Cannot read property

This error indicates that there is no attribute, usually the attribute before the value is undefined or null.

TypeError: ‘undefined’ is not a function

This error is usually reported when executing a method on an object that does not exist. Indicates that the method does not exist in this object.

3. Uncaught RangeError: Maximum call stack

You get this error when you recurse and you don’t write boundary condition judgments, because the function keeps repeating itself.

TypeError: Cannot read property ‘length’ 4. TypeError: Cannot read property ‘length’

If the length attribute is null or undefined, this error will be reported.

5. Uncaught TypeError: Cannot set property

This error is reported if the property is preceded by null or undefined.

6. ReferenceError: event is not defined

In most cases, you use undefined without declaring the variable.

Conclusion: code error is mostly caused by null and undefined, so when writing code to take into account some special cases of processing, to avoid errors.