Skip to content

JavaScript reviews still say callbacks run after the outer function finishes #71473

Closed

Description

@jerome-queck

Describe the Issue

The callback definition under ‘Callback Functions and the forEach Method’ is incorrect in both the Higher Order Functions review and the JavaScript chapter review. It says the callback runs after the main function has finished. Synchronous callbacks, including the forEach example immediately below the definition, run before the receiving function returns.

This is a follow-up to #64439. #64758 corrected the chapter review, but #66056 reintroduced the old definition. The module review also still contains it. Both copies are present on main at f599986.

Affected Page

https://www.freecodecamp.org/learn/javascript-v9/review-javascript-higher-order-functions/review-javascript-higher-order-functions

Your code

Reproduction run in Node.js:

const order = ['before forEach'];
[1, 2].forEach(value => order.push(`callback ${value}`));
order.push('after forEach');
console.log(order);

Actual output:

[ 'before forEach', 'callback 1', 'callback 2', 'after forEach' ]

Expected behavior

Both reviews should use the definition already in the corresponding lecture: a callback is passed to another function so that the outer function can invoke it at a specific point. The definition should not require the outer function to finish first.

Screenshots

No response

System

  • Device: Linux development environment
  • OS: Linux
  • Browser: Not applicable; reproduced from the curriculum source with Node.js
  • Version: Node.js v24.22.1

Additional context

Affected source files:

Existing lecture definition:
https://github.com/freeCodeCamp/freeCodeCamp/blob/f5999861310d414d93119930152b38755cb3e09f/curriculum/challenges/english/blocks/lecture-working-with-higher-order-functions-and-callbacks/67329ffd75010f5ddeb4ea13.md

MDN also identifies forEach and map callbacks as synchronous: https://developer.mozilla.org/en-US/docs/Glossary/Callback_function

Searched open issues and PRs for callback, higher order, and the affected review identifiers; found no open report or fix for these definitions.

Activity

  1. added
    scope: curriculum
    status: waiting triage
    on Oct 31, 2026
  2. added theissue type on Oct 31, 2026
  3. added
    help wanted
    and removed
    status: waiting triage
    on Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedscope: curriculum

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions