Debugging
What Went Wrong? Troubleshooting JavaScript.
Name some key differences between a Syntax Error and a Logic Error.
-
Syntax errors: These are spelling errors in your code that actually cause the program not to run at all, or stop working part way through — you will usually be provided with some error messages too. These are usually okay to fix, as long as you are familiar with the right tools and know what the error messages mean.
-
Logic errors: These are errors where the syntax is actually correct but the code is not what you intended it to be, meaning that program runs successfully but gives incorrect results. These are often harder to fix than syntax errors, as there usually isn’t an error message to direct you to the source of the error.
List a few types of errors that you have encountered in past lab assignments and explain how you were able to correct them. I have encountered syntax errors from wither ‘fat fingering’ and needing to fix an item, change a colon to a semi-colon, or adding a needed space. These errors have typically been easy to fix. I have also encountered syntax errors where I didn’t know what ther proper syntax was, however I am getting better at identifying these as I continue to learn about proper syntax.
My logc errors stem from an intial lack of being able to propery break a problem down, and a lack of knowledge of how to approach these problems. As I continue to work through projects I am gaining a better understanding of how the system functions, and how I need to think to get it to do what I want it to do.
How will this topic continue to influence your long term goals? I will seek to get better at using the emmit to keep syntax errors to a minimum. I will also continue to work through projects and read code to better understand both syntax and how to think through solutions that are elegant and as direct as possible.
The JavaScript Debugger.
How would you describe the JavaScript Debugger tool and how it works to someone just starting out in software development? Tha javascript debugger tool is a means to see what is happening in JavaScript, and reason one’s way through problems. In addition to reporting errors, it allows one to play with the code that it is attached to to see how it can be affected, which allows one to create solutions in the tool that can then be implemented into the JS code.
Define what a breakpoint is. Places in your code that you want to pause execution and identify the problems that prevent your code from executing properly.
What is the call stack? The Call stack section shows you what code was executed to get to the current line.