A lab for practicing reading and interpreting error messages in JavaScript
Clone or download
Pull request Compare This branch is even with dc-wdi-fundamentals:master.
Zakk Fleischmann
Latest commit b882e74 May 23, 2018

README.md

General Assembly Logo

JavaScript Errors and Debugging

Two of the most common challenges developers face are debugging and dealing with errors. This is especially true for junior developers like yourself. The goal of this lab is to give you exposure to some of the most common JavaScript errors and what causes them.

Errors and bugs can have a variety of causes. For example,

  • Missing an important piece of syntax (like ], ), ,).
  • Inaccurate access of an object property or an item in an array.
  • Inaccurate or incomplete logic.
  • Incorrect usage of a method.

JavaScript will throw an error with a message explaining (as best it can) what the cause is. Interpreting these messages is a learned skill, one you have the opportunity to practice with this lab!

Prerequisites

  • JavaScript data types and control flow
  • Working with JavaScript objects and arrays
  • JavaScript functions and methods
  • Array methods and callbacks

Instructions

  1. Fork and clone this repository.
  2. Change into the new directory.
  3. Work through the prompts in lib/errors.md and make a commit after completing each prompt.
  4. Turn in the lab via a pull request.

Starter code is available in lib/. A pull request is required for the lab to be considered complete and turned in.

Requirements

This lab contains 10 prompts inside lib/errors.md. Each prompt includes a short snippet of JavaScript code that has an error or bug in it. Your task is to review the code and the error it creates, then determine the cause of the error and how you can fix it.

Each prompt asks three questions:

  1. What is the error message?
  2. What is causing the error?
  3. How can you resolve/fix the error?

Write your answers inside of lib/errors.md. Your answers can be written or you can provide a fixed code snippet. Make a commit after each prompt. Then turn your lab in with a pull request on this repository.

We've provided an html file inside of lib/ that you can use to test out the code. Add each code snippet to the html file and review it in the browser.

Please format your responses in Markdown. Use this cheetsheat to see how to do so

Bonus

If you finish with these 10 bugs, explore some of the debugging Katas on Code Wars.

License

  1. All content is licensed under a CC­BY­NC­SA 4.0 license.
  2. All software code is licensed under GNU GPLv3. For commercial use or alternative licensing, please contact legal@ga.co.