It would be nice if you could handle your own logic errors at runtime, but sadly, there is no such code construct yet. All code examples on all pages, unless otherwise indicated, are BSD licensed. Today's article will discuss the syntax error, along with two other error types, while the next installment will cover the remaining three. Unlike a program with a syntax error, a program with a logic error is a valid program in the language, though it does not behave as intended. have a peek here
Syntax error Runtime error Logical error Syntax error It is the error which occurs due to incomplete or incorrect code statement and does not follow on or more sytactical rule. Listing 2: Representing theJavaScipt runtime error. In above example, syntax is correct but it will cause a runtime error because it will try to call From the menu, select tools. Once you figure this out, however, you'll find that your debugging time will decrease and your satisfaction with the code will increase.