🌍 Worldwide · Programming

Javascript Programming Syllabus

Roadmap to Javascript Programming. The full Javascript Programming syllabus: 6 chapters, 28 topics and 92 sub-topics, with 51 flashcards written against it.

6Chapters
28Topics
92Sub-topics
51Flashcards

Javascript Programming syllabus — full chapter and topic list

Expand any chapter to see its topics and sub-topics. This is the whole examinable outline for Javascript Programming, not a summary of it.

  1. Introduction to JavaScript

    3 topics
    • What is JavaScript?
      • History of JavaScript
      • JavaScript in Web Development
      • JavaScript vs Other Languages
    • Setting Up Environment
      • Installing a Code Editor
      • Setting Up Node.js
      • Using Browser Developer Tools
    • Basic Syntax
      • Variables and Data Types
      • Operators
      • Control Structures
  2. Core JavaScript Concepts

    6 topics
    • Variables and Data Types
      • var, let, const
      • Primitive Data Types
      • Type Conversion
    • Operators
      • Arithmetic Operators
      • Comparison Operators
      • Logical Operators
      • Assignment Operators
    • Control Structures
      • if-else Statements
      • switch Statements
      • Loops (for, while, do-while)
    • Functions
      • Function Declaration
      • Function Expressions
      • Arrow Functions
      • Higher-Order Functions
      • Closures
    • Scope and Hoisting
      • Global vs Local Scope
      • Function Scope
      • Block Scope
      • Hoisting
    • Objects and Arrays
      • Object Literals
      • Array Methods
      • Destructuring
      • Spread and Rest Operators
  3. Advanced JavaScript Concepts

    6 topics
    • Asynchronous JavaScript
      • Callbacks
      • Promises
      • Async/Await
    • Error Handling
      • try-catch-finally
      • Custom Errors
    • Event Loop and Concurrency
      • Call Stack
      • Event Queue
      • Web APIs
    • Modules
      • ES6 Modules
      • CommonJS
      • AMD
    • Object-Oriented Programming
      • Classes
      • Inheritance
      • Polymorphism
      • Encapsulation
    • Functional Programming
      • Pure Functions
      • Immutability
      • Higher-Order Functions
      • Currying
  4. JavaScript in the Browser

    4 topics
    • DOM Manipulation
      • Selecting Elements
      • Modifying Elements
      • Event Listeners
    • Browser Events
      • Event Types
      • Event Bubbling and Capturing
      • Debouncing and Throttling
    • Web Storage
      • Local Storage
      • Session Storage
      • Cookies
    • AJAX and Fetch API
      • XMLHttpRequest
      • Fetch API
      • Handling Responses
  5. JavaScript Frameworks and Libraries

    5 topics
    • Introduction to Frameworks and Libraries
      • Why Use Frameworks?
      • Popular Frameworks and Libraries
    • React
      • Components
      • State and Props
      • Lifecycle Methods
      • Hooks
    • Vue
      • Vue Instance
      • Data Binding
      • Directives
      • Components
    • Angular
      • Modules
      • Components
      • Services
      • Dependency Injection
    • jQuery
      • DOM Manipulation
      • Event Handling
      • AJAX with jQuery
  6. JavaScript Best Practices

    4 topics
    • Code Quality
      • Linting
      • Formatting
      • Code Reviews
    • Performance Optimization
      • Minification
      • Lazy Loading
      • Caching
    • Security
      • XSS
      • CSRF
      • Content Security Policy
    • Testing
      • Unit Testing
      • Integration Testing
      • End-to-End Testing

Javascript Programming flashcards

The complete Javascript Programming deck: 51 questions with worked answers.

  1. What is JavaScript?

    A high-level, interpreted (JIT-compiled), dynamically-typed, multi-paradigm programming language originally created to add interactivity to web pages. It is single-threaded, prototype-based, and conforms to the ECMAScript specification.

  2. What is the difference between JavaScript and ECMAScript?

    ECMAScript (ECMA-262) is the standardized specification that defines the language's core syntax and semantics. JavaScript is the most widely-used implementation of that specification, adding host objects (like the DOM/BOM in browsers).

  3. What are two common runtime environments for executing JavaScript?

    The browser (using engines like V8 in Chrome, SpiderMonkey in Firefox) and Node.js (a server-side runtime built on the V8 engine).

  4. What is Node.js and what is it used for?

    Node.js is a JavaScript runtime built on Chrome's V8 engine that allows JavaScript to run outside the browser. It is used for server-side applications, command-line tools, and build tooling, and uses an event-driven, non-blocking I/O model.

  5. What is npm?

    npm (Node Package Manager) is the default package manager for Node.js. It installs, manages, and shares reusable code packages, with dependencies tracked in a package.json file.

  6. How do you include external JavaScript in an HTML page, and what do the async and defer attributes do?

    Use `<script src="file.js"></script>`. `defer` downloads the script in parallel and executes it after the HTML is parsed (in order); `async` downloads in parallel and executes as soon as ready (order not guaranteed).

  7. How do you write single-line and multi-line comments in JavaScript?

    Single-line comments use `//`. Multi-line (block) comments use `/* ... */`.

  8. Is JavaScript case-sensitive, and are semicolons required?

    Yes, JavaScript is case-sensitive (`myVar` and `myvar` differ). Semicolons are technically optional due to Automatic Semicolon Insertion (ASI), but explicitly using them is recommended to avoid ambiguity.

  9. What is the difference between var, let, and const?

    `var` is function-scoped and hoisted (initialized as undefined); `let` is block-scoped and can be reassigned; `const` is block-scoped and cannot be reassigned (though object contents can still mutate). Both `let` and `const` are subject to the temporal dead zone.

  10. List the seven primitive data types in JavaScript.

    String, Number, BigInt, Boolean, Undefined, Null, and Symbol. Everything else (objects, arrays, functions) is a non-primitive (reference) type.

  11. What does the typeof operator return for null, and why?

    `typeof null` returns `"object"`. This is a long-standing bug in the language kept for backward compatibility; null is actually a primitive.

  12. What is the difference between null and undefined?

    `undefined` means a variable has been declared but not assigned a value (the default). `null` is an explicit assignment representing the intentional absence of any object value.

  13. What is NaN and how do you reliably test for it?

    `NaN` (Not-a-Number) is a special numeric value representing an invalid or unrepresentable arithmetic result. It is the only value not equal to itself, so test with `Number.isNaN(x)` or `x !== x` rather than `x === NaN`.

  14. What is the difference between == and === in JavaScript?

    `==` (loose equality) compares values after performing type coercion; `===` (strict equality) compares both value and type with no coercion. Using `===` is generally recommended to avoid unexpected results.

  15. What are truthy and falsy values? List all the falsy values.

    Falsy values coerce to false in a boolean context. The eight falsy values are: `false`, `0`, `-0`, `0n` (BigInt zero), `""` (empty string), `null`, `undefined`, and `NaN`. Everything else is truthy.

  16. What do the logical operators &&, ||, and ?? evaluate to?

    `&&` returns the first falsy operand or the last operand if all are truthy; `||` returns the first truthy operand or the last if all are falsy; `??` (nullish coalescing) returns the right operand only when the left is `null` or `undefined`.

  17. What is the difference between the ++ operator in prefix (++x) vs postfix (x++) form?

    `++x` (prefix) increments the value and returns the new value; `x++` (postfix) returns the original value first, then increments. For example, if `x = 5`, `x++` yields 5 but leaves x as 6, while `++x` yields 6.

  18. What is the result and type of 5 + '5' versus 5 - '5' in JavaScript?

    `5 + '5'` produces the string `"55"` (the `+` operator concatenates when one operand is a string). `5 - '5'` produces the number `0` (the `-` operator coerces both operands to numbers).

  19. How does the ternary conditional operator work?

    It has the form `condition ? exprIfTrue : exprIfFalse`. It evaluates the condition and returns the first expression if truthy, otherwise the second. It is the only JavaScript operator taking three operands.

  20. What is the difference between a for...in and a for...of loop?

    `for...in` iterates over the enumerable property keys (indices/names) of an object. `for...of` iterates over the values of an iterable (arrays, strings, Maps, Sets). Use `for...of` for arrays and `for...in` for object keys.

Show the other 31 Javascript Programming flashcards
  1. What is the difference between a while loop and a do...while loop?

    A `while` loop checks its condition before each iteration, so the body may run zero times. A `do...while` loop checks the condition after the body, guaranteeing the body executes at least once.

  2. What do the break and continue statements do inside loops?

    `break` immediately terminates the entire loop (or switch). `continue` skips the rest of the current iteration and proceeds to the next iteration of the loop.

  3. What is the difference between a function declaration and a function expression?

    A function declaration (`function foo(){}`) is fully hoisted and can be called before its definition. A function expression (`const foo = function(){}`) is only available after the assignment line executes because only the variable is hoisted.

  4. How do arrow functions differ from regular functions regarding `this`?

    Arrow functions do not have their own `this`; they lexically inherit `this` from the enclosing scope. They also lack their own `arguments` object and cannot be used as constructors (no `new`).

  5. What are default parameters and rest parameters in JavaScript functions?

    Default parameters provide a fallback value when an argument is omitted or undefined, e.g. `function f(a = 10){}`. Rest parameters (`...args`) collect all remaining arguments into a single array.

  6. What is a closure in JavaScript?

    A closure is a function that retains access to variables from its lexical (enclosing) scope even after that outer function has finished executing. Closures are the basis for data privacy and stateful functions in JavaScript.

  7. What is a callback function?

    A callback is a function passed as an argument to another function, to be invoked later—either synchronously (e.g. `Array.map`) or asynchronously (e.g. after an I/O event completes).

  8. What is variable and function hoisting?

    Hoisting is JavaScript's behavior of moving declarations to the top of their scope during compilation. Function declarations and `var` variables are hoisted (var initialized to `undefined`), while `let`/`const` are hoisted but remain uninitialized in the temporal dead zone.

  9. What is the Temporal Dead Zone (TDZ)?

    The TDZ is the period between entering a scope and the actual declaration of a `let` or `const` variable. Accessing the variable during this window throws a ReferenceError, even though the variable is technically hoisted.

  10. What is the difference between lexical (static) scope and dynamic scope, and which does JavaScript use?

    Lexical scope determines variable access based on where functions are physically written in the source code. Dynamic scope would resolve based on the call stack at runtime. JavaScript uses lexical scope.

  11. What are the different ways `this` is bound in JavaScript?

    `this` depends on call site: in a method call it is the owning object; in a plain function call it is the global object (or undefined in strict mode); with `new` it is the new instance; with `call`/`apply`/`bind` it is explicitly set; in arrow functions it is lexically inherited.

  12. What is the difference between accessing object properties with dot notation versus bracket notation?

    Dot notation (`obj.key`) requires a valid, static identifier name. Bracket notation (`obj['key']`) accepts any string or computed expression, allowing dynamic keys, keys with special characters, or variables holding the key name.

  13. How do you clone/copy an object shallowly in modern JavaScript?

    Use the spread operator `{...obj}` or `Object.assign({}, obj)`. Both create a shallow copy, meaning nested objects are still shared by reference. For a deep copy use `structuredClone(obj)`.

  14. What is the difference between Object.freeze() and Object.seal()?

    `Object.freeze()` makes an object fully immutable—no adding, deleting, or modifying properties. `Object.seal()` prevents adding or deleting properties but still allows modifying existing property values.

  15. Name four commonly used array mutator methods and four non-mutating methods.

    Mutators (change the original): `push`, `pop`, `shift`, `unshift`, `splice`, `sort`, `reverse`. Non-mutating (return new): `map`, `filter`, `slice`, `concat`, `reduce`.

  16. What does Array.prototype.reduce() do?

    `reduce` iterates over an array, accumulating a single result value. It takes a reducer callback `(accumulator, current) => ...` and an optional initial value, e.g. summing: `arr.reduce((a, c) => a + c, 0)`.

  17. What is the difference between synchronous and asynchronous code?

    Synchronous code executes line-by-line, blocking further execution until each operation finishes. Asynchronous code allows long-running operations (I/O, timers, network) to proceed in the background, with results handled later via callbacks, promises, or async/await.

  18. What is a Promise and what are its three states?

    A Promise is an object representing the eventual completion or failure of an asynchronous operation. Its three states are: pending (initial), fulfilled (resolved with a value), and rejected (failed with a reason). State transitions are one-way and final.

  19. How do async/await keywords work?

    `async` marks a function that always returns a promise. `await` pauses execution inside an async function until a promise settles, returning its resolved value (or throwing on rejection), letting asynchronous code read like synchronous code.

  20. What is the difference between Promise.all() and Promise.race()?

    `Promise.all()` waits for all promises to fulfill and returns an array of results, rejecting immediately if any one rejects. `Promise.race()` settles as soon as the first promise settles (fulfills or rejects), returning that single result.

  21. How do you catch errors when using async/await?

    Wrap the awaited call in a `try...catch` block: the `catch` clause handles any rejected promise. Alternatively, chain `.catch()` on the returned promise of the async function.

  22. What is the difference between throw and a try...catch...finally block?

    `throw` raises an exception, unwinding the stack until caught. `try` contains code that may throw, `catch` handles the thrown error, and `finally` runs regardless of whether an error occurred—useful for cleanup.

  23. Name three built-in JavaScript error types.

    Common built-in errors include `TypeError` (wrong type/operation), `ReferenceError` (accessing an undeclared variable), `SyntaxError` (invalid code), `RangeError` (value out of range), and `URIError`. All inherit from `Error`.

  24. What is the JavaScript event loop, and what are the call stack, task queue, and microtask queue?

    The event loop continuously moves queued callbacks onto the empty call stack. The call stack tracks running functions; the macrotask queue holds callbacks like `setTimeout`; the microtask queue holds promise callbacks. Microtasks are drained completely before the next macrotask.

  25. Why does a Promise .then() callback run before a setTimeout(fn, 0) callback scheduled earlier?

    Promise callbacks are microtasks, while `setTimeout` callbacks are macrotasks. After each macrotask, the event loop empties the entire microtask queue before picking up the next macrotask, so microtasks always have priority.

  26. What is the difference between CommonJS and ES Modules (ESM)?

    CommonJS (Node.js) uses `require()` and `module.exports`, loads synchronously, and is dynamic. ES Modules use `import`/`export`, are statically analyzable, support asynchronous loading and tree-shaking, and are the standard for browsers and modern Node.

  27. What is the difference between a named export and a default export in ES Modules?

    A module can have many named exports, imported by their exact names in braces: `import { a, b } from './m'`. It can have only one default export, imported with any chosen name without braces: `import anything from './m'`.

  28. What is prototypal inheritance in JavaScript?

    Objects inherit properties and methods from other objects via an internal prototype link (`[[Prototype]]`, accessed by `__proto__` or `Object.getPrototypeOf`). Property lookups traverse this prototype chain until found or reaching `null`.

  29. What does the `new` keyword do when creating an object from a constructor function or class?

    `new` (1) creates a fresh empty object, (2) links its prototype to the constructor's `.prototype`, (3) binds `this` to the new object and runs the constructor, and (4) returns the object automatically unless the constructor returns another object.

  30. What is the DOM (Document Object Model)?

    The DOM is a tree-structured, in-memory, language-neutral representation of an HTML/XML document. Each node is an object that scripts can access and manipulate to change document structure, content, and styling dynamically.

  31. What is the difference between event capturing, targeting, and bubbling in DOM event propagation, and what does event delegation exploit?

    An event travels down from the root to the target (capturing phase), reaches the target, then travels back up (bubbling phase). Event delegation exploits bubbling by attaching one listener to a common ancestor to handle events from many child elements. `stopPropagation()` halts this flow.

Javascript Programming syllabus FAQ

What is in the Javascript Programming syllabus?

The Javascript Programming syllabus is split into 6 chapters: Introduction to JavaScript, Core JavaScript Concepts, Advanced JavaScript Concepts, JavaScript in the Browser, JavaScript Frameworks and Libraries and JavaScript Best Practices. Together they contain 28 topics and 92 sub-topics.

How many chapters and topics are in the Javascript Programming syllabus?

6 chapters and 28 topics, broken down further into 92 sub-topics. The largest chapter is Core JavaScript Concepts, with 6 topics.

Are there Javascript Programming flashcards?

Yes — 51 question-and-answer flashcards, printed in full on this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.