[null, {"document_url": "https://coursework.vschool.io/debugging-2/", "unformatted_src": "/content/images/2018/10/Screen-Shot-2018-10-09-at-3.14.10-PM.png", "src": "https://coursework.vschool.io/content/images/2018/10/Screen-Shot-2018-10-09-at-3.14.10-PM.png", "formatted_filename": "Screen Shot at", "alt_text": "Screen-Shot-2018-10-09-at-3.14.10-PM"}, null, {"document_url": "https://coursework.vschool.io/debugging-2/", "unformatted_src": "/content/images/2018/10/Screen-Shot-2018-10-09-at-2.47.39-PM.png", "src": "https://coursework.vschool.io/content/images/2018/10/Screen-Shot-2018-10-09-at-2.47.39-PM.png", "formatted_filename": "Screen Shot at", "alt_text": "Screen-Shot-2018-10-09-at-2.47.39-PM"}, null, {"document_url": "https://coursework.vschool.io/debugging-2/", "unformatted_src": "/content/images/2018/10/Screen-Shot-2018-10-10-at-10.52.11-AM.png", "src": "https://coursework.vschool.io/content/images/2018/10/Screen-Shot-2018-10-10-at-10.52.11-AM.png", "formatted_filename": "Screen Shot at", "alt_text": "Screen-Shot-2018-10-10-at-10.52.11-AM"}, null, null]
One of the first and most natural types of debugging is just looking through our code for typos, misused variables, or errors given to us by our text editor. In the screenshot below we will see some examples of errors given by our text editor. Take a minute to look at the code above and compare the working examples to their broken counterparts. Familiarizing yourself with these helpful hints will greatly assist you in resolving bugs within your code.

Another useful tool are the errors given to you by Node.js in your Terminal. Below are some examples taken from the Daily Planet Editor. At first glance this error can seem quite overwhelming, but let's take a closer look.

Debugging with Google You will notice above that we have googled the same error from our above example, but we added in the word node. When googling errors or anything code related, it is always a good idea to tag on at the end the language you are using. If I were using vanillaJS you would write js at the end instead of node, if you were using React you would write react, if you were using python you would write python etc...


You will often be lead to a stack overflow link when searching errors or specific bugs.

Use the video below as a guide for where to look on these pages Other Google resources

With regards to the Daily Planet Editor, run the code in Node.js. This will show you an error similar to the one shown at the beginning of this write-up. Follow the processes explained, then run the code again and see if you get the same error or a different one. Repeat this until you no longer get any errors and the code seems to be running as expected.

Debugging Part 2