View on GitHub

reading-notes

Debugging can be the hardest part of coding. Figuring out new logic can create bugs that require time to figure out and fix. Learning how to debug can save time and make for more effecient coding and understanding of the language.

Reading

What Went Wrong? Troubleshooting JavaScript.

Name some key differences between a Syntax Error and a Logic Error.

A syntax error is an error in how the code is written. JavaScript wont know how to run the code do to the mistake, it could be a typo, or a missing bracket. a Logic error will still run, but the result of the code isn’t what you intend to get back. Using subtraction instead of addtion is an example of a logic error.

List a few types of errors that you have encountered in past lab assignments and explain how you were able to correct them.

TypeErrors I got from putting the wrong varable as an argument. I had an error from trying to reassign a const varible as well.

SyntaxErrors I got a few from missing brackets or random text in the middle of the code.

ReferenceErrors, I got one from putting my varible below where I was trying to call it.

How will this topic continue to influence your long term goals?

learning the specific names of error will help me in debugging in the future. Reading the type of error sometimes without the line number, I will instanly know what the bug is.

##The JavaScript Debugger.

How would you describe the JavaScript Debugger tool and how it works to someone just starting out in software development?
Normally JS runs like a freight train down the tracks, if it hits a flaw in the code, the train will come off the rails. The debugger lets you run the code line by line to see exacly what is happening, which can find bugs in the code.

Define what a breakpoint is.
You can set breakpoints in the debugger so that the code will run to that point and pause. You can use that to find errors in your code.

What is the call stack?
The call stack is all the tasks that javascript is performing. Its written in an order it will perform everything it does. It generates the stack the first time it passing through the code, then will add to the stack as it runs a second time digging deeper into functions and nested values.

Things I want to know more about