js_flashcards_engine

(11 cards)

1
Q

What is a JavaScript engine? Examples?

A

Executes JS code. Examples: V8, SpiderMonkey, JavaScriptCore, Chakra.

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

Three types of Execution Contexts?

A

Global, Function, Eval.

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

What is the Global Execution Context?

A

Base context created first. In browsers, associated with window/globalThis.

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

What is the Call Stack?

A

LIFO structure tracking active execution contexts.

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

What happens if Call Stack is too large?

A

Stack Overflow error, often from infinite recursion.

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

What is the Event Loop?

A

Mechanism for async operations, monitors call stack and task queue.

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

What are Microtasks?

A

High-priority tasks after each macrotask. Examples: Promise .then, queueMicrotask.

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

What are Macrotasks?

A

Executed after microtasks. Examples: setTimeout, setInterval, I/O.

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

How does async code run in JS?

A

Offloaded to APIs, callback queued, event loop pushes to call stack when clear.

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

What is the Task Queue?

A

Holds callbacks awaiting execution, processed by event loop.

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

Difference between Stack and Heap?

A

Stack: static memory (primitives, calls).
Heap: dynamic memory (objects, arrays).

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