Occurs when the code violates the grammar rules of the programming language.
// Example:
console.log("Hello World") // Missing semicolon
Code runs but gives wrong output due to incorrect logic.
// Example:
function isEven(num) {
return num % 2 === 1; // Incorrect logic
}
Error that occurs during code execution.
// Example: let x = 5 / 0; // Division by zero
Error prevents the code from compiling (in compiled languages).
// C Example: #includeint main() { printf("Hello"); return 0; }
Code is syntactically correct but does not do what is intended.
Error in using external APIs or libraries.
Causes the program to run slower than expected.
Creates vulnerabilities, such as SQL injection possibilities.
Works in one environment or browser but fails in another.
Related to improper memory or resource usage.
Happens in concurrent executions like race conditions.