JavaScript & TypeScript
Core language concepts explained in plain English — closures, async patterns, TypeScript types, and modern syntax.
- Closure /ˈkləʊʒər/
A function that retains access to its outer scope even after the outer function has returned.
"The counter function uses a closure — each call to makeCounter() creates an independent count variable that persists."
- Hoisting /ˈhɔɪstɪŋ/
JavaScript's behaviour of moving variable and function declarations to the top of their scope before execution.
"The bug was caused by hoisting — the var was accessible before its assignment, returning undefined."
- Promise /ˈprɒmɪs/
An object representing the eventual completion or failure of an asynchronous operation, with .then()/.catch() chaining.
"We chain .then() calls on the fetch Promise to parse the JSON and update the UI after the request resolves."
- async / await /eɪˈsɪŋk / əˈweɪt/
Syntax sugar over Promises that lets you write asynchronous code that reads like synchronous code.
"Using async/await makes the data-fetching logic much easier to read — no more nested callbacks or .then() chains."
- Type Narrowing /taɪp ˈnærəʊɪŋ/
TypeScript's mechanism of refining a type within a conditional block using typeof, instanceof, or discriminant properties.
"After the typeof check, TypeScript narrows the type from string | number to string, enabling string methods."
- Generics /dʒɪˈnerɪks/
A way to create reusable components that work with any type, defined with type parameters like <T>.
"The getFirst<T>(arr: T[]): T function is generic — it preserves the exact type of the array element it returns."
- Destructuring /diːˈstrʌktʃərɪŋ/
Syntax for unpacking values from arrays or properties from objects into distinct variables.
"We use destructuring in the function signature: ({ userId, role }) => ... to avoid accessing props.userId repeatedly."
- Rest / Spread /rest / spred/
Rest (...args) collects remaining elements; spread (...arr) expands an iterable into individual elements.
"Spread merges two objects: const merged = { ...defaults, ...overrides }. Rest captures extra args: function log(msg, ...meta)."
- Type Guard /taɪp ɡɑːd/
A function whose return type is a type predicate (x is SomeType) that tells TypeScript what type a value is at runtime.
"The isUser type guard checks for the presence of .userId so TypeScript knows the type inside the if-block."
- Interface vs Type /ˈɪntəfeɪs vəs taɪp/
Both define object shapes. Interfaces are extendable via declaration merging; types can express unions, intersections, and primitives.
"We use interface for public API contracts because it can be extended by consumers; type alias for complex union types internally."
- Union Type /ˈjuːnjən taɪp/
A type formed with | that allows a value to be one of several types: string | number | null.
"The API response ID is typed as string | number because legacy records use integers and new ones use UUIDs."
- Optional Chaining /ˈɒpʃənl ˈtʃeɪnɪŋ/
The ?. operator that short-circuits property access if the value to the left is null or undefined.
"Using user?.profile?.avatar prevents a TypeError if profile is undefined — returns undefined instead of throwing."
- Nullish Coalescing /ˈnʌlɪʃ kəʊˈælesɪŋ/
The ?? operator returns the right-hand side only when the left-hand side is null or undefined (not falsy).
"timeout ?? 5000 returns 5000 only if timeout is null/undefined — unlike ||, it won't replace 0 with the default."
- Utility Types /juːˈtɪlɪti taɪps/
Built-in TypeScript generic types for transforming other types: Partial<T>, Required<T>, Pick<T,K>, Readonly<T>, Record<K,V>.
"We use Partial<UserSettings> as the parameter type for the update function so only provided fields are required."
- Event Loop /ɪˈvent luːp/
The mechanism that processes the call stack, microtask queue (Promises), and macrotask queue (setTimeout) in order.
"Understanding the event loop explains why console.log after an awaited Promise always runs before setTimeout callbacks."
Quick Quiz — JavaScript & TypeScript
Test yourself on these 15 terms. You'll answer 10 multiple-choice questions — each shows a term, you pick the correct definition.
What does this term mean?
Quiz complete!
Frequently Asked Questions
How many terms are in the JavaScript & TypeScript vocabulary set?
The JavaScript & TypeScript set has 15 terms, each with a definition, pronunciation, and an example sentence showing real-world usage.
What level is the JavaScript & TypeScript vocabulary set?
This set is labelled Intermediate–Advanced. If you find it too challenging, browse the full vocabulary list to find a set closer to your current level.
Is this vocabulary set free to study?
Yes. Every vocabulary set on CoderSlingo, including this one, is completely free — no account, sign-up, or payment required.
What study modes are available for this set?
Three modes: a searchable Study List showing all terms with definitions and examples, Flashcards for active recall practice, and a Quiz that tests you with multiple-choice questions.
Is my flashcard progress saved?
Yes — your "learned" status for each flashcard is saved in your browser's local storage, so it persists between visits on the same device.
Is there a matching interactive exercise for this set?
Yes — click "Practice exercises" above to test yourself on these exact terms in a scored, multiple-choice exercise.
Can I search within this vocabulary set?
Yes — use the search box above the term list to filter instantly by word, definition, or example as you type.
Is the JavaScript & TypeScript set linked to any career role paths?
Vocabulary sets that map to specific IT roles (like Frontend Developer or DevOps Engineer) show a "Part of" list above linking to those role paths — check the header for this set.
How is a quiz question scored?
Each quiz question shows one term and four possible definitions; you pick the correct one. At the end you get a percentage score and a summary message based on how many you got right.
Where can I find more vocabulary sets like this one?
Browse the full Vocabulary hub for all study sets, organised by topic — from Agile and Git to Cloud Infrastructure, Security, and AI/ML.