Javascript Error and Debugging

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/32

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 7:16 PM on 5/6/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

33 Terms

1
New cards

Errors

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

2
New cards

syntax

The “grammar” in the programming language is the _____, a set of rules that defines the structure of the instructions

3
New cards

keywords

while the “vocabulary” are the ___ or list of words that can be used to build instructions

4
New cards

Correct Message:

After leaving the mall, turn right into the second path, and drive 600 m. Wait on the spot.

5
New cards

Syntax Error: missing period

This error violates the language syntax rule, as a declarative sentence should end with a period.

6
New cards

Semantic Error: pth

This new word is not recognizable in the vocabulary of the natural language, thus creating an error. It can also be a word that is out of context, such as using “male” instead of “mall”.

7
New cards

Logical Error: left

It is an error as it is not what was originally the intended direction compared to the original message. This error is not easily detectable by the compiler.

8
New cards

SyntaxError

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

9
New cards

iff (true) {

console.log("true");

}

Error message: //-> Uncaught SyntaxError: Unexpected token '{'

10
New cards

ReferenceError

in JavaScript, as the compiler does not know its meaning. This error occurs when the programmer tries to access a function or a variable that does not exist

11
New cards

let a = 3;
let a = c;

Error mesage: //-> Uncaught ReferenceError: c is not defined

12
New cards

TypeError

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.

13
New cards

const someConstValue = 4;
someConstValue = 3;

Error message: // -> Uncaught TypeError: Assignment to constant variable

14
New cards

let someNumber = 12;

someNumber.length();

Error message: // -> Uncaught TypeError: someNumber.length is not a function

15
New cards

RangeError

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

16
New cards

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

// -> 10

let testArray2 = Array(-1);

console.log(testArray2.length);

Error message: // -> Uncaught RangeError: Invalid array length

17
New cards

throws

it generates and ___ specific objects with information about the encountered error. In syntax errors, the JavaScript engine does not allow the program to run and uses the console to show the error message.

18
New cards

run-time errors, or exceptions

other errors, which appear while the program is running.

19
New cards

console.log('123');

conole.log('456');

console.log('890');

The word conole has caused a ReferenceError, which stops the program from working after the first line.

20
New cards

Exception handling, or error handling

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

21
New cards

finally Statement

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. 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.

22
New cards

Debugging

is part of troubleshooting in programming.

23
New cards

Step-by-Step Program Execution

  1. Resume

  2. Step Into

  3. Step Over

  4. Step Out

24
New cards

Resume

resumes the execution of the script typically. The debugger runs the program and “breaks” on user-defined breakpoints

25
New cards

Step Into

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.

26
New cards

Step Over

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

27
New cards

Step Out

allows to immediately jump out of a function where the code is paused. This action proceeds until the function returns if the debugger is within the code block

28
New cards
29
New cards
30
New cards
31
New cards
32
New cards
33
New cards