1. Syntax Error
This is the most common Error and it happens when you use wrong syntax in comparison to predefined syntax. For example -
let name = 'agrittiwari':
2. Reference Error
Reference Error is thrown when we want to refer a variable that does not exist, it means the variable is not declared. For example -
let name = 'agrittiwari'; console.log(age);
RangeError is thrown to indicate that a passed function argument does not fall within the valid set or range of acceptable values. For example -
let arr = new Array(50000000000);
The maximum number of elements that you can set for an array is ( 2^32 -1 )
The TypeError object represents an error when an operation could not be performed, typically (but not exclusively) when a value is not of the expected type.
A TypeError may be thrown when:
an operand or argument passed to a function is incompatible with the type expected by that operator or function; or when attempting to modify a value that cannot be changed; or when attempting to use a value in an inappropriate way
For example -
let number = 5; number.split("");
5. URI Error
6. Eval Error
The Eval Error just simply indicates an error regarding the global
7. Internal Error
This error occurs internally in the JS engine, especially when it has too much data to handle and the stack grows way over its critical limit.
This also occurs when the JS engine is overwhelmed by too many recursions, Switch cases, etc.
Debugging errors is the skill of a pro programmer and it can only be sharpen by resolving as much errors as you can from your codebase. It is a great way to strengthen your core concepts about the language.
Thank you for reading!!
Did you find this article valuable?
Support Agrit Tiwari by becoming a sponsor. Any amount is appreciated!