Recall & Review
beginner
What is the purpose of the Node.js built-in debugger?
The Node.js built-in debugger helps you find and fix errors in your code by letting you pause execution, inspect variables, and step through your program line by line.
Click to reveal answer
beginner
How do you start the Node.js built-in debugger from the command line?
You start it by running your script with the command
node inspect your_script.js. This launches the debugger interface in the terminal.Click to reveal answer
intermediate
What command do you use in the Node.js debugger to continue execution until the next breakpoint?
Use the
cont or c command to continue running until the next breakpoint or pause point.Click to reveal answer
intermediate
Explain the use of the
repl command in the Node.js debugger.The
repl command opens a Read-Eval-Print Loop where you can type JavaScript expressions to inspect or change variables while paused.Click to reveal answer
beginner
How can you set a breakpoint in your Node.js code to use with the built-in debugger?
Insert the statement
debugger; in your code where you want to pause. When running with the debugger, execution will stop at that line.Click to reveal answer
Which command starts the Node.js built-in debugger?
✗ Incorrect
The correct command is
node inspect script.js to start the built-in debugger.What does the
cont command do in the Node.js debugger?✗ Incorrect
The
cont command resumes running the program until it hits the next breakpoint or finishes.How do you pause execution at a specific line in your code when debugging?
✗ Incorrect
The
debugger; statement pauses execution when the debugger is running.What is the purpose of the
repl command in the Node.js debugger?✗ Incorrect
The
repl command opens an interactive prompt to evaluate JavaScript expressions while paused.Which of these is NOT a feature of the Node.js built-in debugger?
✗ Incorrect
The debugger helps find bugs but does not automatically fix them.
Describe how to use the Node.js built-in debugger to find a bug in your code.
Think about starting, pausing, stepping, and checking values.
You got /4 concepts.
Explain the role of the
debugger; statement in Node.js debugging.It's a special line you add to pause your program.
You got /3 concepts.