JavaScript has types of errors. Syntax errors happen when you write invalid code. The engine catches these before running.
Runtime errors occur during execution. Accessing undefined properties or calling non-functions triggers these. Logic errors are the trickiest. Your code runs but produces wrong results. These require careful debugging.