Execution Model, Scope, and Memory

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

1/55

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 6:55 PM on 4/25/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

56 Terms

1
New cards

Execution Context

A temporary internal environment JavaScript creates to run code

2
New cards

Global Execution Context

The first execution context created when a program starts

3
New cards

Function Execution Context

A new execution context created every time a function is called

4
New cards

Call Stack

A stack of active execution contexts

5
New cards

Creation Phase

The setup phase where bindings and scope links are prepared before execution

6
New cards

Execution Phase

The phase where JavaScript runs code line by line

7
New cards

Hoisting

JavaScript setting up bindings before execution begins

8
New cards

var Hoisting

var declarations are initialized as undefined during creation phase

9
New cards

let Hoisting

let declarations are hoisted but uninitialized until declaration line

10
New cards

const Hoisting

const declarations are hoisted but uninitialized until declaration line

11
New cards

Temporal Dead Zone

The period where let/const exist in scope but cannot be accessed yet

12
New cards

Scope

Rules that determine where variables are accessible

13
New cards

Global Scope

Top-level scope of the runtime environment

14
New cards

Function Scope

Variables accessible only inside the function they were declared in

15
New cards

Block Scope

Variables accessible only inside a block using let/const

16
New cards

Module Scope

Each Node.js file has its own private scope

17
New cards

Lexical Scope

Variable lookup based on where code was defined not where called

18
New cards

Closure

A function that keeps access to variables from where it was created

19
New cards

Lexical Environment

The scope data structure a function can reference for variable lookup

20
New cards

Closure Memory Survival

Variables survive because a live function still references them

21
New cards

Shared Closure

Multiple references to same returned function share same closed-over state

22
New cards

Separate Closure

Separate factory calls create separate private environments

23
New cards

Counter Closure

A closure pattern using private state like count++

24
New cards

Primitive Value

A simple value like number string boolean null undefined bigint symbol

25
New cards

Primitive Copy

Assigning a primitive copies the value independently

26
New cards

Reference Value

A value that refers to an object in memory

27
New cards

Object Reference

Multiple variables can reference the same object

28
New cards

Mutation

Changing properties inside an existing object

29
New cards

Reassignment

Making a variable point to a new value or object

30
New cards

Mutation Effect

Mutating a shared object affects all references to it

31
New cards

Reassignment Effect

Reassigning one variable does not change other references

32
New cards

Pass By Value

JavaScript always passes arguments by value

33
New cards

Reference Illusion

Objects seem pass-by-reference because copied values are references

34
New cards

Stack Overflow

Error caused by too many nested calls on the call stack

35
New cards

Recursion

A function calling itself

36
New cards

Function Declaration Hoisting

Function declarations are available before their line executes within scope

37
New cards

Function Expression Hoisting

A variable may hoist but assigned function does not exist until assignment

38
New cards

var Block Behavior

var ignores block scope and uses function/global scope

39
New cards

let Block Behavior

let respects block scope

40
New cards

const Block Behavior

const respects block scope and requires initialization

41
New cards

Scope Chain

JavaScript searches current scope then outer scopes for variables

42
New cards

Closest Scope Rule

JavaScript uses nearest matching variable name first

43
New cards

Shadowing

Inner variable with same name hides outer variable

44
New cards

Node Module Privacy

File variables are private unless exported

45
New cards

Middleware Factory

A function returning middleware while capturing config values

46
New cards

Service Factory

A function creating services while capturing dependencies

47
New cards

Private State via Closure

Closure can hide internal data from outside access

48
New cards

Shared Config Bug

Mutating one shared object changes behavior elsewhere

49
New cards

var Loop Bug

var in async loop often prints final loop value repeatedly

50
New cards

Call Stack Push

A function call adds a new context to the stack

51
New cards

Call Stack Pop

When function finishes its context is removed

52
New cards

Synchronous Execution

JavaScript runs one stack frame at a time in order

53
New cards

Debugging Stack Trace

A stack trace shows nested calls leading to an error

54
New cards

Captured Variable

A variable referenced by an inner function from outer scope

55
New cards

Factory Function

A function that returns configured functions or objects

56
New cards

State Isolation

Creating new closures prevents accidental shared state