Deck 4: Debugging and Error Handling
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Match between columns
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/41
Play
Full screen (f)
Deck 4: Debugging and Error Handling
1
Syntax refers to the order in which various parts of a program run, or execute.
False
2
You log values to the console using the window.alert()method.
False
3
You enclose code that may contain an exception in a ____ statement.
A) throw
B) catch
C) throws
D) try
A) throw
B) catch
C) throws
D) try
D
4
For each error encountered, a browser's console displays a line numberand a description of the error.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
5
A program's ____ is the order in which various parts of the program run, or execute.
A)logic
B)syntax
C)call stack
D)console
A)logic
B)syntax
C)call stack
D)console
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
6
The window.alert()debugging methodresults in messages ____ .
A)written to the text of the document being debugged
B)displayed in dialog boxes
C)displayed in the browser console
D)available only to the JavaScript processor
A)written to the text of the document being debugged
B)displayed in dialog boxes
C)displayed in the browser console
D)available only to the JavaScript processor
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
7
A breakpoint is a designation added to a specific statement in a program that causes program execution to pause when it reaches that statement.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
8
The console.log()debugging methodresults in messages ____ .
A)written to the text of the document being debugged
B)displayed in dialog boxes
C)displayed in the browser console
D)available only to the JavaScript processor
A)written to the text of the document being debugged
B)displayed in dialog boxes
C)displayed in the browser console
D)available only to the JavaScript processor
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
9
The ____ is the ordered list maintained by a JavaScript processor containing all the procedures that have been called but have not yet finished processing.
A) call queue
B) call heap
C) call stack
D) methods list
A) call queue
B) call heap
C) call stack
D) methods list
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
10
The rules of a programming language are known as its ____.
A)logic
B)syntax
C)call stack
D)console
A)logic
B)syntax
C)call stack
D)console
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
11
A ____ error is a flaw in a program's design that prevents the program from running as you anticipate.
A) compile-time
B) syntax
C) logic
D) run-time
A) compile-time
B) syntax
C) logic
D) run-time
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
12
After you throw an error, you use a ____ statement to handle the error.
A) try
B) catch
C) handle
D) capture
A) try
B) catch
C) handle
D) capture
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
13
A ____ error occurs when the interpreter fails to recognize code.
A) logic
B) syntax
C) web
D) run-time
A) logic
B) syntax
C) web
D) run-time
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
14
____ allows programs to handle errors as they occur in the execution of a program.
A) Error coding
B) Form validation
C) Input validation
D) Exception handling
A) Error coding
B) Form validation
C) Input validation
D) Exception handling
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
15
Each time a program calls a procedure, the procedure is added to the top of the call stack, and then removed after it finishes executing.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
16
When using the console.log() method to trace bugs, it can be helpful to use a ____ program.
A) script
B) hub
C) tracing
D) driver
A) script
B) hub
C) tracing
D) driver
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
17
The debugging tools built into modern browsers are especially useful in tracking down ____ .
A)compile-time errors
B)syntax errors
C)run-time errors
D)logic errors
A)compile-time errors
B)syntax errors
C)run-time errors
D)logic errors
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
18
____ is the temporary suspension of program execution so you can monitor values and trace program execution.
A)The call stack
B)Break mode
C)Debugging
D)Tracing
A)The call stack
B)Break mode
C)Debugging
D)Tracing
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
19
A ____ error occurs when the JavaScript interpreter encounters a problem while a program is executing.
A) run-time
B) syntax
C) logic
D) browser
A) run-time
B) syntax
C) logic
D) browser
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
20
You use a ____ statement within a try block to specify an error message .
A) catch
B) call
C) throw
D) throws
A) catch
B) call
C) throw
D) throws
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
21
____________________ is the process of tracing and resolving errors in a program.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
22
Writing values directly to the console is known as ____.
A)logging
B)writing
C)stepping out
D)breaking
A)logging
B)writing
C)stepping out
D)breaking
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
23
You implement custom error handling using the ____________________ event.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
24
The term ____________________ refers to the temporary suspension of program execution so that you can monitor values and trace program execution.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
25
Match between columns
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
26
What is the difference between syntax errors and run-time errors?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
27
Name two tools you can use to analyze your HTML code for errors, and describe how to use them for this task.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
28
An infinite loop is an example of a(n)____ error.
A)syntax
B)run-time
C)logic
D)user
A)syntax
B)run-time
C)logic
D)user
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
29
After you evaluate code for exceptions, you can use a ____ statement to perform cleanup or necessary tasks.
A) try
B) throw
C) catch
D) finally
A) try
B) throw
C) catch
D) finally
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
30
Which of the following JavaScript statements requests that processors remove some features from the language and require more stringent syntax for other features?
A) break;
B)"use strict";
C) debugger;
D) console.log();
A) break;
B)"use strict";
C) debugger;
D) console.log();
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
31
Explain the three stepping options found in the debugging tools in modern browsers.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
32
Explain how strict mode can be useful in debugging.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
33
____________________ is the examination of individual statements in an executing program.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
34
What is the difference between a variables list and a watch list in browser debugging tools?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
35
Describe two advantages of implementing custom error handling.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
36
What is a dependency and what role do dependencies play in debugging?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
37
Explain how access to the call stack is useful in debugging.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
38
Briefly explain how to use comments to locate bugs with JavaScript.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
39
Which of the following JavaScript statements works like a breakpoint?
A) break;
B)"use strict";
C) debugger;
D) console.log();
A) break;
B)"use strict";
C) debugger;
D) console.log();
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
40
In ____________________ mode, some features are removed from the language, while other features require more stringent syntax.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
41
How is setting breakpoints useful in debugging?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck