Types of Errors :
There are three main types of errors that can occur while compiling a JavaScript program.
1. syntax errors,
2. runtime errors, and
3. logical errors.
1. Syntax Errors (most common)
Incorrect syntax raises parsing errors and occur at the interpretation time.
Simple example is to introduce a semicolon where a double-colon it's needed.
Ex :
let exObj = { name; 'Rick' }
Runtime Errors
Occur after the compiler interpret the code, when the code ran. Also known as exceptions.
It can occur by calling a function that It wasn't declared.
3. Logical Errors (most difficult to find)
Error in the flow of data. The logical elements are well structured,
the syntax is correct, but the confluence of data lands improperly.
Synthesis
syntax errors : while interpretation. Simple example: misspelling.
runtime errors: while execution. Simple example: due to misuse.
logical errors: scrambled logical perform. Simple example: ''Terminator kills John Connor.''