CS401A's Pre-Finals: Fundaments of Web Prog. Module 07 Flashcards

For pre-final and final exams. (30 cards)

1
Q

in the operation of programs happen due to misconceptions when solving a problem, improper use and typos of the programming language, or the inability to predict user behavior.

A

Errors and Exceptions (OpenEDG, 2023)
Errors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Programming language communicates just like natural language in that it has its grammer and vocabulary. The “grammar” in the programming language is the

A

Errors and Exceptions (OpenEDG, 2023)
syntax,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

a set of rules that defines the structure of the instructions,

A

Errors and Exceptions (OpenEDG, 2023)
syntax,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Programming language communicates just like natural language in that it has its grammer and vocabulary.
in the programming language
vocabulary” are the

A

Errors and Exceptions (OpenEDG, 2023)
keywords

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

or list of words that can be used to build instructions.

A

Errors and Exceptions (OpenEDG, 2023)
keywords

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Errors and Exceptions (OpenEDG, 2023)

appears when a code is ill-formed,
when typos occur, or when unmatching parenthesis or brackets. The code cannot even be executed as JavaScript cannot understand it.

A

SyntaxError
A SyntaxError

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Errors and Exceptions (OpenEDG, 2023)

iff (true) {
console.log("true");
}

\_\_\_\_\_\_Error

A

(OpenEDG, 2023)
SyntaxError

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Errors and Exceptions (OpenEDG, 2023)

The error occurs when the programmer tries to access a function or a variable that does not exist.

A

(OpenEDG, 2023)
ReferenceError

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Errors and Exceptions (OpenEDG, 2023)

let a = 3;
let a = c;

\_\_\_\_\_\_\_\_\_Error

A

ReferenceError

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Errors and Exceptions (OpenEDG, 2023)

This error occurs when a specific value is not of the expected type, such as changing the constant value or checking the length of a variable that is not a string.

A

TypeError

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Errors and Exceptions (OpenEDG, 2023)

const someConstValue = 4;
someConstValue = 3;



let someNumber = 12;
someNumber.length();

\_\_\_\_Error

A

TypeError

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Errors and Exceptions (OpenEDG, 2023)

This error is generated when a value is passed to a function outside its acceptable range.

A

RangeError

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Errors and Exceptions (OpenEDG, 2023)

let testArray1 = Array(10);
console.log(testArray1.length);

let testArray2 = Array(-1);
console.log(testArray2.length);

\_\_\_\_\_Error

A

RangeError

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Errors and Exceptions (OpenEDG, 2023)

When JavaScript detects syntactic or semantic errors, it generates and \_\_\_\_\_\_ specific objects with information about the encountered error.

A

throws

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Errors and Exceptions (OpenEDG, 2023)

Other errors, however, are called \_\_\_\_\_\_\_\_ errors, or \_\_\_\_\_\_\_\_\_\_, which appear while the program is running.

A

run-time
exceptions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Errors and Exceptions (OpenEDG, 2023)

is done to prevent the program from stopping in such a situation.

A

Exception handling, or error handling,

17
Q

Errors and Exceptions (OpenEDG, 2023)

If an exception is thrown in the code block after the try keyword, the program will not interrupt completely but instead jumps to the part of the code after the catch keyword and continues from there.

A

Exception handling, or error handling,

18
Q

Errors and Exceptions (OpenEDG, 2023)

Just like the catch block, this is also an optional block of the try statement, although at least one of them is required or a SyntaxError is thrown.

A

finally Statement

19
Q

Errors and Exceptions (OpenEDG, 2023)

It can be used with or without the catch block and is always executed after the try and catch blocks, no matter what errors are thrown.

A

finally Statement

20
Q

Errors and Exceptions (OpenEDG, 2023)

try {
    // code to try
} finally {
    // this will always be executed
}

This is the syntax for the

A

try.. finally statement.

21
Q

Errors and Exceptions (OpenEDG, 2023)

let a = 5;
try {
    a = 10;
} finally {
    console.log(a);
}
console.log(a);

The content of the finally block is executed, as the new value (\_\_) is displayed instead of the initial declaration (\_\_).

22
Q

is part of troubleshooting in programming.
causes the program to stop or halt its execution on the line where it is placed and waits for a decision.

A

Debugging (OpenEDG, 2023)
Debugging
The debugger statement

23
Q
console.log("Before debugger");
debugger;
console.log("After debugger");

If debugging is present in a browser, the console in the developer tool will only show the \_\_\_\_\_\_ \_\_\_\_\_\_\_\_ \_\_\_

A

Debugging (OpenEDG, 2023)
Before debugger log
and display whether the code execution stopped, paused in the debugger, or is currently in debug mode.

24
Q

It is a debugger feature to execute codes on a \_\_\_\_\_\_\_\_\_\_\_\_ basis.

A

Debugging (OpenEDG, 2023)
Step-by-Step Program Execution
step-by-step

25
It means that program execution can be stopped at any place using the `________ _________` and then continue the execution one instruction at a time.
**Debugging (OpenEDG, 2023)** **Step-by-Step Program Execution** `debugger` statement
26
``` console.log("Before debugger"); debugger; console.log("After debugger"); ``` The second log is not shown since the debugger statement also works as a `__________` in the code execution, pausing the debugger execution.
**Debugging (OpenEDG, 2023)** **breakpoint**
27
— resumes the execution of the script typically. The debugger runs the program and "*breaks*" on the user-defined breakpoints.
**Debugging (OpenEDG, 2023)** **Step-by-Step Program Execution** * **Resume**
28
— treats the function as a set of instructions intended to be executed separately. It is used when the code needs to be analyzed in detail. The debugger will jump inside the code of the next instruction if it is a function call.
**Debugging (OpenEDG, 2023)** **Step-by-Step Program Execution** * **Step Into**
29
— is used when the next instruction is a call to a function where the impact is unclear or uninterested. It treats the function call as something indivisible.
**Debugging (OpenEDG, 2023)** **Step-by-Step Program Execution** * **Step Over**
30
— allows to immediately jump out of a function where the code is paused. This action proceeds until the function returns if the debugger is written within the code block.
**Debugging (OpenEDG, 2023)** **Step-by-Step Program Execution** * **Step Out**