Skip to content

The-Marcy-Lab-School/js-debugging-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Debugging

Being able to debug errors is one of the most important skills you'll build as a programmer. Most of the time during your work, your code will have bugs in it. That's a good thing - if you didn't have any bugs, you wouldn't have any work to do!

Your task: another developer wrote an application to build a lottery application. The app picks a random number between 1 and 100 and sends the message to the browser via an alert. Unfortunately, the program contains many bugs. The developer who wrote it actually won the lottery, moved to Maui, and stopped returning your calls. You'll need to use your debugging skills to fix the program!

This lesson will focus on your ability to read error messages. You'll be starting with some broken code, and through your debugging process will eventaully turn it into working code! Follow the prompt below.

  1. Fork this lab and clone down a local copy.

  2. Open index.html and look in the console in your developer tools. What is the error message that you see?

  3. What line number does the error message point to?

  4. Looking at that line number, what do you think the problem is? What's the simplest way you can fix this error?

  5. Make the change you suggested in line number three. Re-run the file by refreshing the index.html page.

Repeat steps 1-4 until your program works as intended! The program works as intended when you see an alert message which shows your lucky number!

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •