Students will apply debugging tools and strategies to identify and fix errors in a pre-written JavaScript application.
This exercise emphasizes using:
- The Console
- The Sources tab
- The
debuggerstatement - Practical strategies like isolating problematic code and testing edge cases
You are tasked with debugging a simple JavaScript application for an e-commerce platform.
The application is supposed to:
- Calculate the total price of items in a shopping cart
- Apply discounts
- Generate a receipt
Unfortunately, the application has several bugs that are causing it to malfunction.
You will:
- 🐛 Identify and fix errors using browser developer tools
- 🔍 Analyze error messages and the call stack for clues
- 🧪 Test edge cases to make sure the program behaves correctly in different scenarios
- Open the project’s
index.htmlfile in your browser - Launch Developer Tools using:
F12, orCtrl+Shift+I(Windows) /Cmd+Option+I(Mac)
From there, use the Console, Sources tab, and debugger statements to investigate and fix issues in the JavaScript code.
Let me know if you'd like to add starter files, error clues, or a checklist of bugs to find!