An important part of JavaScript coding is adding error handling for instances where there may be problems. By default, if a code exception occurs because of a problem in your JavaScript, the script fails and does not finish loading. This is not usually the desired behavior. In fact, it is often catastrophic behavior. To prevent these types of big problems, you should wrap your code in a try
/catch
block.