JavaScript Basic Debugging in Browser DevTools Quiz

JavaScript
0 Passed
0% acceptance

Understand 30 questions covering how to open DevTools, inspect the DOM, use the console, set and manage breakpoints, step through code, inspect the call stack, monitor network calls, leverage overrides, analyze performance and memory, debug event listeners, and work in responsive design mode.

30 Questions
~60 minutes
1

Question 1

Which shortcut typically opens DevTools on Windows/Linux?

A
Ctrl + Shift + I
B
Alt + F4
C
Ctrl + P
D
Shift + Esc
2

Question 2

What does the Elements panel allow you to do?

A
Inspect and edit the DOM and associated CSS
B
Throttle network speed
C
Profile CPU usage
D
View IndexedDB storage
3

Question 3

How can you select an element directly from the page for inspection?

A
Click the picker icon in DevTools, then hover over the element
B
Use console.clear()
C
Reload the page
D
Run document.getElementById() blindly
4

Question 4

Which tool helps you toggle CSS properties without editing source files?

A
The Styles pane within Elements
B
The Network panel
C
The Memory panel
D
The Lighthouse panel
5

Question 5

When debugging layout issues, why is the Box Model section useful?

A
It visualizes padding, border, and margin for the selected node
B
It logs JavaScript errors
C
It records network waterfalls
D
It profiles garbage collection
6

Question 6

Which panel evaluates JavaScript expressions and displays log output?

A
Console
B
Network
C
Memory
D
Elements
7

Question 7

What benefit does the Console provide during debugging?

A
You can test snippets against the current page context
B
It blocks network traffic
C
It edits server files
D
It profiles CPU usage automatically
8

Question 8

Which panel allows you to set JavaScript breakpoints and step through code?

A
Sources
B
Network
C
Performance
D
Application
9

Question 9

What happens when you click a line number in the Sources panel?

A
A breakpoint is added, pausing execution when that line is reached
B
The line is deleted
C
The code is minified
D
The file downloads
10

Question 10

Why is pretty-printing useful in DevTools?

A
It formats minified code to make it readable for debugging
B
It removes code entirely
C
It caches responses
D
It obfuscates source maps
11

Question 11

What type of breakpoint is shown?

javascript
// In Sources panel
if (user.isAdmin) {
  // breakpoint set on next line
  loadDashboard()
}
A
Line breakpoint
B
XHR breakpoint
C
DOM breakpoint
D
Event listener breakpoint
12

Question 12

What does a conditional breakpoint allow you to do?

A
Pause only when a specified expression evaluates to true
B
Pause for every network request
C
Pause when CSS changes
D
Pause only on syntax errors
13

Question 13

How do you set a conditional breakpoint?

javascript
// Right-click a line number
// Enter condition: order.total > 100
A
Right-click the breakpoint icon and add an expression
B
Use console.assert
C
Disable JavaScript
D
Use the Network panel
14

Question 14

What does Step Over do in the debugger?

A
Executes the current line without entering called functions
B
Runs to the end of the script
C
Reloads the page
D
Skips all breakpoints
15

Question 15

What does Step Into accomplish?

javascript
function a() { b() }
function b() { console.log('b') }
a() // pause on this line and Step Into
A
Moves into function b() to debug inside it
B
Skips b() entirely
C
Continues execution without pausing
D
Clears all breakpoints
16

Question 16

If you need to resume execution until the current function returns, which control do you use?

A
Step Out
B
Step Into
C
Pause on exceptions
D
Disable breakpoints
17

Question 17

What is the impact of enabling "Pause on caught exceptions"?

A
The debugger stops even when try/catch handles the error
B
It pauses only on uncaught errors
C
It ignores exceptions entirely
D
It prevents exceptions from being thrown
18

Question 18

What information does the Call Stack panel provide during a pause?

A
The chain of function calls leading to the breakpoint
B
Network request timings
C
CSS specificity
D
Media query matches
19

Question 19

What does evaluating watch expressions allow you to do?

A
Monitor variable values as you step through code
B
Throttle CPU
C
Edit HTTP headers
D
Persist console output
20

Question 20

What do the red entries in the Network panel typically indicate?

A
Requests that failed (e.g., 404/500)
B
Requests served from cache
C
Requests still pending
D
Requests with large payloads
21

Question 21

How can you monitor fetch calls automatically?

javascript
// In Sources > XHR/fetch breakpoints
// Add breakpoint for URL containing "api"
A
Add an XHR/fetch breakpoint with a matching pattern
B
Use console.log
C
Disable JavaScript
D
Edit CSS
22

Question 22

What does the code below demonstrate?

javascript
// Event Listener Breakpoints
// Mouse > click checked
// Clicking the page pauses execution
A
Pausing when a click event fires anywhere on the page
B
Blocking all mouse events permanently
C
Throttling network requests
D
Editing DOM nodes automatically
23

Question 23

Why might you use Local Overrides in DevTools?

A
To persist file edits across reloads without changing the server
B
To clear cookies automatically
C
To minify files on the fly
D
To disable CSP
24

Question 24

What does this throttling setting accomplish?

javascript
// Network panel
// Throttle dropdown -> Slow 3G
A
Simulates limited bandwidth and higher latency for realistic testing
B
Increases server CPU load
C
Boosts GPU rendering speed
D
Stops DOM mutations
25

Question 25

How can the Network panel help debug failed API calls?

A
Inspect request/response headers, payloads, and status codes
B
Edit CSS rules
C
Profile JavaScript memory
D
Record performance traces
26

Question 26

What do the Timeline bars in the Network panel indicate?

A
Phases such as queuing, DNS lookup, connect, and response
B
JavaScript call stack depth
C
CSS rule specificity
D
Heap allocation size
27

Question 27

How can you filter Network entries to view only XHR/fetch requests?

javascript
// Network panel
// Click the XHR filter button or type "-resource-type:other"
A
Use the XHR filter or type resource-type filters in the search bar
B
Disable cache
C
Switch to the Console panel
D
Use the Memory panel
28

Question 28

What does the following screenshot scenario represent?

javascript
// Network table
// A fetch request returning 304 Not Modified
A
The response came from cache without downloading the body
B
The request failed
C
The response is fully delayed
D
The server returned HTML only
29

Question 29

How do you inspect the initiator of a request in Network panel?

A
Click the request and check the Initiator section
B
Use console.timeEnd
C
Toggle device emulation
D
Open the Application panel
30

Question 30

Why use responsive design mode in DevTools?

A
To simulate different device viewports, DPR, and user agents
B
To minify JavaScript
C
To compile CSS
D
To generate service workers automatically

QUIZZES IN JavaScript