1. Name some key differences between a Syntax Error and a Logic Error.
2. A few types of errors that you have encountered in past lab assignments and explain how you were able to correct them.
Some common errors include:
TypeError: “x” is not a function: This often occurs due to incorrect casing or spelling of a method, such as writing addeventListener instead of the correct addEventListener.
querySelector(). Adding the proper CSS selector fixed the reference.Math.floor().3. How will this topic continue to influence your long term goals?
Developing strong troubleshooting skills is essential for any software developer’s career. Learning these basics now will save hours of frustration and allow for faster progression through more complex coding challenges. Mastering the tools to find and fix errors independently makes a developer more efficient and self-reliant.
1. Describe the JavaScript Debugger tool
The JavaScript Debugger is a powerful tool built into modern web browsers that allows you to pause the execution of your code at any point to see exactly what is happening. Instead of just running the script and seeing it fail, the debugger lets you watch the values of variables in real-time and step through the code line-by-line to identify exactly where and why a problem is occurring.
2. Define breakpoint.
A breakpoint is a specific place you “mark” in your code where you want the browser to pause execution. This allows you to inspect the current state of the program at that exact moment to help identify bugs.
3. Define call stack?
The call stack is a section within the debugger that shows the path the code took to arrive at the current line. It lists the functions that were executed to get to the current point, helping you understand the sequence of events that led to a specific state or error.