🌍 freeCodeCamp · subject

freeCodeCamp JavaScript Algorithms and Data Structures Syllabus

Every chapter and topic of JavaScript Algorithms and Data Structures examined in freeCodeCamp — 7 chapters, 24 topics, plus 50 flashcards written against it.

7Chapters
24Topics
0Sub-topics
~20hEst. first pass
17%Of freeCodeCamp
50Flashcards

JavaScript Algorithms and Data Structures syllabus — full chapter and topic list

Expand any chapter to see its topics and sub-topics. This is the whole examinable outline for JavaScript Algorithms and Data Structures in freeCodeCamp, not a summary of it.

  1. JavaScript Fundamentals

    4 topics
    • Variables and Data Types
    • Operators and Expressions
    • Conditionals
    • Loops
  2. Functions

    3 topics
    • Function Declarations and Expressions
    • Arrow Functions
    • Scope and Closures
  3. Arrays and Objects

    3 topics
    • Array Methods
    • Object Manipulation
    • Iteration and Lookups
  4. Object Oriented Programming

    3 topics
    • Constructors and Prototypes
    • Classes
    • this Keyword
  5. Functional Programming

    3 topics
    • Pure Functions and Immutability
    • Higher Order Functions
    • Currying and Composition
  6. Algorithmic Thinking

    4 topics
    • Algorithm Design
    • Searching and Sorting
    • Recursion
    • Regular Expressions
  7. Certification Projects

    4 topics
    • Palindrome Checker
    • Roman Numeral Converter
    • Telephone Number Validator
    • Cash Register

JavaScript Algorithms and Data Structures flashcards for freeCodeCamp

19 of 50 cards from the JavaScript Algorithms and Data Structures deck — real questions with worked answers.

  1. What are the seven primitive data types in JavaScript?

    string, number, bigint, boolean, undefined, symbol, and null. Everything else (objects, arrays, functions) is of type object (functions report "function" via typeof but are objects).

  2. What is the difference between var, let, and const in JavaScript?

    var is function-scoped, hoisted and initialized to undefined, and can be redeclared. let and const are block-scoped and in the temporal dead zone until declared. const additionally cannot be reassigned (though object contents it references can still be mutated).

  3. What is the difference between undefined and null in JavaScript?

    undefined means a variable has been declared but not assigned a value (the default). null is an intentional assignment representing "no value." Note: typeof undefined is "undefined" while typeof null is "object" (a historical quirk).

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

    == is loose equality: it performs type coercion before comparing (e.g., '5' == 5 is true). === is strict equality: it compares both value and type with no coercion ('5' === 5 is false). Best practice is to use ===.

  5. List the eight falsy values in JavaScript.

    false, 0, -0, 0n (BigInt zero), "" (empty string), null, undefined, and NaN. Every other value is truthy, including "0", [], and {}.

  6. What do the logical operators && and || return in JavaScript (short-circuit evaluation)?

    They return one of their operands, not necessarily a boolean. a && b returns a if a is falsy, otherwise b. a || b returns a if a is truthy, otherwise b. Evaluation stops as soon as the result is determined (short-circuiting).

  7. What is the syntax and meaning of the ternary (conditional) operator?

    condition ? valueIfTrue : valueIfFalse. It is an expression that evaluates the condition and returns the first value if truthy, otherwise the second. Example: const status = age >= 18 ? 'adult' : 'minor'.

  8. Why must you usually include a break statement in each case of a switch statement?

    Without break, execution "falls through" into the next case's code even though its value did not match. break exits the switch after the matched case runs. Intentional fall-through is used to let multiple case labels share one code block.

  9. What are the three parts of a classic for loop header, and when does each run?

    for (initialization; condition; final-expression): initialization runs once before the loop starts; the condition is checked before every iteration (loop runs while it is truthy); the final-expression (e.g., i++) runs after each iteration.

  10. 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 runs the body first and checks the condition after, so the body always executes at least once.

  11. What is the difference between for...of and for...in loops?

    for...of iterates over the values of an iterable (arrays, strings, Maps, Sets). for...in iterates over the enumerable property keys of an object (including inherited ones). Use for...of for arrays and for...in for object keys.

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

    A declaration (function foo() {}) is a standalone statement and is fully hoisted, so it can be called before it appears in the code. A function expression (const foo = function() {}) assigns a function to a variable; only the variable binding is hoisted, so calling it before the assignment throws an error.

  13. What value does a JavaScript function return if it has no return statement?

    undefined. A function with no return, or a bare return with no value, implicitly returns undefined.

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

    Default parameters give an argument a fallback value when it is undefined: function greet(name = 'Guest'). The rest parameter collects all remaining arguments into a real array: function sum(...nums), allowing a variable number of arguments.

  15. Write the arrow-function equivalent of: function double(x) { return 2 * x; }

    const double = x => 2 * x; With a single parameter the parentheses are optional, and a single-expression body has an implicit return (no braces or return keyword needed).

  16. How do arrow functions handle the this keyword differently from regular functions?

    Arrow functions have no this of their own; they lexically inherit this from the enclosing scope at definition time. Regular functions get this dynamically from how they are called. Arrow functions therefore cannot be rebound with call/apply/bind and are unsuitable as object methods or constructors.

  17. When must you use parentheses around the body of an arrow function that implicitly returns an object literal?

    Always: const makeUser = name => ({ name }); Without the parentheses the braces are parsed as a function block, not an object, so the function would return undefined.

  18. What is lexical scope in JavaScript?

    Scope determined by where functions and blocks are written in the source code, not where they are called. Inner functions can access variables of all enclosing (outer) scopes; the engine resolves a variable by searching outward through the scope chain.

  19. What is a closure in JavaScript?

    A closure is a function bundled together with references to its lexical (outer) scope, allowing it to access outer variables even after the outer function has returned. Closures enable data privacy, counters, and function factories.

See more JavaScript Algorithms and Data Structures flashcards →

Planning JavaScript Algorithms and Data Structures for freeCodeCamp

JavaScript Algorithms and Data Structures is about 17% of the freeCodeCamp syllabus by topic count — 24 of 145 topics, spread over 7 chapters. At roughly 45 minutes per topic plus 12 minutes per sub-topic, a first pass runs to about 20 hours.

The heaviest chapters are JavaScript Fundamentals (4 topics), Algorithmic Thinking (4 topics), Certification Projects (4 topics) . Front-load those while your energy is high; the short chapters are better revision filler later.

Work top-down: read the chapter, then tick topics off individually rather than marking the whole chapter done. Sub-topics are where silent gaps hide.

JavaScript Algorithms and Data Structures (freeCodeCamp) FAQ

What is in the freeCodeCamp JavaScript Algorithms and Data Structures syllabus?

JavaScript Algorithms and Data Structures is split into 7 chapters — JavaScript Fundamentals, Functions, Arrays and Objects, Object Oriented Programming, Functional Programming and Algorithmic Thinking, and 1 more, containing 24 topics and 0 sub-topics in total.

How many chapters are there in JavaScript Algorithms and Data Structures for freeCodeCamp?

7 chapters. JavaScript Algorithms and Data Structures accounts for about 17% of the topics in the whole freeCodeCamp syllabus (24 of 145).

How long should I spend on JavaScript Algorithms and Data Structures for freeCodeCamp?

Budget around 20 hours for a first pass through JavaScript Algorithms and Data Structures — about 45 minutes per topic plus 12 minutes per sub-topic across its 24 topics. Add revision cycles on top.

Are there flashcards for freeCodeCamp JavaScript Algorithms and Data Structures?

Yes — a 50-card JavaScript Algorithms and Data Structures deck. Sample cards are printed on this page, and the full deck is free in the Examius app with spaced repetition scheduling.