0
0
Node.jsframework~10 mins

Debugging with VS Code in Node.js - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start debugging by setting a breakpoint in VS Code.

Node.js
console.log('Hello, world!'); // Set a [1] here to pause execution
Drag options to blanks, or click blank then click option'
Aconsole
Bdebugger
Cbreakpoint
Dwatch
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'debugger' keyword instead of setting a breakpoint in VS Code.
2fill in blank
medium

Complete the launch configuration to debug a Node.js app in VS Code.

Node.js
{
  "type": "node",
  "request": "launch",
  "name": "Launch Program",
  "program": "${workspaceFolder}/[1]"
}
Drag options to blanks, or click blank then click option'
Apackage.json
Bindex.js
CREADME.md
Dlaunch.json
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'package.json' or 'launch.json' instead of the main JS file.
3fill in blank
hard

Fix the error in the debug console command to inspect variable 'count'.

Node.js
Debug console command: [1] count
Drag options to blanks, or click blank then click option'
Aevaluate
Bconsole.log
Cinspect
Dprint
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'print' or 'console.log' which are not valid debug console commands.
4fill in blank
hard

Fill both blanks to set a conditional breakpoint that pauses when 'x' is greater than 10.

Node.js
// Set conditional breakpoint: right-click on breakpoint and enter condition: x [1] [2]
Drag options to blanks, or click blank then click option'
A>
B10
C==
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' or '<' which do not match the condition 'greater than 10'.
5fill in blank
hard

Fill both blanks to create a watch expression that shows the length of array 'items'.

Node.js
Watch expression: [1]..[2]
Drag options to blanks, or click blank then click option'
Aitems
Blength
Dsize
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'size' which is not a property of JavaScript arrays.