JavaScript gives a message as if it encounters an error. The recognized errors are –
- Load-time errors: The errors shown at the time of the page loading are counted under Load-time errors. The use of improper syntax encounters these errors and is thus detected while the page is getting loaded.
- Runtime errors: This is the error that comes up while the program is running. For example, illegal operations cause the division of a number by zero or access a non-existent area of the memory.
- Logic errors: It is caused by syntactically correct code, which does not fulfill the required task—for example, an infinite loop.