This lab is to help you with reading errors. Remember, debugging is a part of the job as a software engineers; therefore, knowing how to read errors will help speed up the debugging process.
According to { MDN Web Docs }, Error
objects are thrown when runtime errors occur. The Error object can also be used as a base object for user-defined exceptions.
Here are the list of errors you may encounter using JavaScript:
1. { RangeError }
- List of
RangeError
2. { ReferenceError }
- List of
ReferenceError
- ReferenceError: "x" is not defined
- ReferenceError: assignment to undeclared variable "x"
- ReferenceError: can't access lexical declaration`X' before initialization
- ReferenceError: deprecated caller or arguments usage
- ReferenceError: invalid assignment left-hand side
- ReferenceError: reference to undefined property "x"
3. { SyntaxError }
- List of
SyntaxError
- SyntaxError: JSON.parse: bad parsing
- SyntaxError: for-in loop head declarations may not have initializers
- SyntaxError: missing ) after argument list
- SyntaxError: missing ) after condition
- SyntaxError: missing : after property id
- SyntaxError: missing ; before statement
- SyntaxError: missing = in const declaration
- SyntaxError: missing } after function body
- SyntaxError: return not in function
4. { TypeError }
- List of
TypeError
5. BONUS: { EvalError }
6. BONUS: { InternalError }
- List of
InternalError
7. BONUS: { URIError }
- List of
URIError