mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
chore(curriculum): rm vids from JS debugging lectures (#61611)
This commit is contained in:
+1
-8
@@ -1,19 +1,12 @@
|
||||
---
|
||||
id: 6733aa9b006d29f4d11307a5
|
||||
title: What Are Some Examples of Common JavaScript Errors?
|
||||
challengeType: 11
|
||||
videoId: e5P8nJkOSMQ
|
||||
challengeType: 19
|
||||
dashedName: what-are-some-examples-of-common-javascript-errors
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
Watch the video or read the transcript and answer the questions below.
|
||||
|
||||
# --transcript--
|
||||
|
||||
What are some examples of common JavaScript errors?
|
||||
|
||||
As you've been programming in JavaScript, you've inevitably run into error messages. Understanding common error messages will help you debug more effectively and develop into a stronger programmer. The four common types of error messages are `SyntaxError`, `ReferenceError`, `TypeError`, and `RangeError`.
|
||||
|
||||
A `SyntaxError` happens when you write something incorrectly in your code, like missing a parenthesis, or a bracket. Think of it like a grammar mistake in a sentence. Here is a common mistake developers make when creating arrays:
|
||||
|
||||
+2
-9
@@ -1,19 +1,12 @@
|
||||
---
|
||||
id: 6733bec70d86e13522e98a4f
|
||||
title: How Does the Throw Statement Work?
|
||||
challengeType: 11
|
||||
videoId: vNlPchT8nr8
|
||||
challengeType: 19
|
||||
dashedName: how-does-the-throw-statement-work
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
Watch the video or read the transcript and answer the questions below.
|
||||
|
||||
# --transcript--
|
||||
|
||||
How does the `throw` statement work?
|
||||
|
||||
The `throw` statement in JavaScript is used to throw a user defined exception. An exception in programming, is when an unexpected event happens and disrupts the normal flow of the program.
|
||||
|
||||
As programmers it is important to handle these exceptions, so your programs don’t crash unexpectedly when errors occur. Here is the basic syntax for the `throw` statement:
|
||||
@@ -48,7 +41,7 @@ function divide(numerator, denominator) {
|
||||
|
||||
Here is an example of a function that will check if the denominator is `0`. If that is the case, then it will throw a custom error message saying `Cannot divide by zero`.
|
||||
|
||||
In the next lecture video, we will look at how to throw errors messages within the context of the `try`/`catch` block which is used to gracefully handle exceptions in JavaScript.
|
||||
In the next lecture, we will look at how to throw errors messages within the context of the `try`/`catch` block which is used to gracefully handle exceptions in JavaScript.
|
||||
|
||||
# --questions--
|
||||
|
||||
|
||||
+1
-8
@@ -1,19 +1,12 @@
|
||||
---
|
||||
id: 6733becf4b0c353553b9bfa4
|
||||
title: How Does the Debugger Statement Work?
|
||||
challengeType: 11
|
||||
videoId: gn0q7gXiMRo
|
||||
challengeType: 19
|
||||
dashedName: how-does-the-debugger-statement-work
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
Watch the video or read the transcript and answer the questions below.
|
||||
|
||||
# --transcript--
|
||||
|
||||
How does the `debugger` statement work?
|
||||
|
||||
The `debugger` statement is a powerful JavaScript tool that lets you pause your code at a specific line to investigate what's going on in the program. When used correctly, the `debugger` statement can save you a lot of time trying to figure out why something is not working as it should.
|
||||
|
||||
JavaScript executes your code from top to bottom. While JavaScript executes your code and hits a `debugger` statement, it immediately pauses execution at that line. This gives you the chance to inspect variables, check functions, and the flow of of the code in general.
|
||||
|
||||
+2
-9
@@ -1,20 +1,13 @@
|
||||
---
|
||||
id: 6733bee844600f35c05b8264
|
||||
title: How Does try...catch...finally Work?
|
||||
challengeType: 11
|
||||
videoId: _3whfUfxGYI
|
||||
challengeType: 19
|
||||
dashedName: how-does-try-catch-finally-work
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
Watch the video or read the transcript and answer the questions below.
|
||||
|
||||
# --transcript--
|
||||
|
||||
How does `try…catch…finally` work?
|
||||
|
||||
In the previous lecture video, you learned how to throw exceptions in your programs. In this lecture video, we will take a look at how to gracefully handle these errors in a `try…catch…finally` block.
|
||||
In the previous lecture, you learned how to throw exceptions in your programs. In this lecture, we will take a look at how to gracefully handle these errors in a `try…catch…finally` block.
|
||||
|
||||
The `try` block is used to wrap code that might throw an error. It acts as a safe space to try something that could fail.
|
||||
|
||||
|
||||
+2
-9
@@ -1,19 +1,12 @@
|
||||
---
|
||||
id: 6733befb703ca6361da3755b
|
||||
title: What Are Some Examples of Using Advanced JavaScript Debugging Techniques?
|
||||
challengeType: 11
|
||||
videoId: hHWAQYXRvxs
|
||||
challengeType: 19
|
||||
dashedName: what-are-some-examples-of-using-advanced-javascript-debugging-techniques
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
Watch the video or read the transcript and answer the questions below.
|
||||
|
||||
# --transcript--
|
||||
|
||||
What are some examples of using advanced JavaScript debugging techniques?
|
||||
|
||||
Debugging your JavaScript programs goes beyond using `console.log()` statements in your code. There are more advanced techniques that make debugging a breeze once you get used to them. Let's go through those more advanced techniques so you'll be happy to debug your JavaScript program once you run into errors.
|
||||
|
||||
The first concept we will take a look at is working with breakpoints. Breakpoints let you pause the execution of your code at a specific line of your choice. After the pause, you can inspect variables, evaluate expressions, and examine the call stack.
|
||||
@@ -36,7 +29,7 @@ Now, let’s move onto inspecting network requests. Inspecting network requests
|
||||
|
||||
To use the Network tab for debugging, open the developer tools and head over to the Network tab, then click on individual requests to see details like headers, responses, and payloads.
|
||||
|
||||
For the last portion of the video, we will focus on `console.table` and `console.dir`.
|
||||
For the last portion of this lecture, we will focus on `console.table` and `console.dir`.
|
||||
|
||||
`console.table()` displays tabular data as a table in the console. It takes one mandatory argument, which must be an array or an object, and one optional argument to specify which properties or columns to display.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user