Skip to content

JavaScript Math Review misstates when the nullish coalescing operator returns a value #71804

Backlog

Description

@Sanjay-doppalapudi

Describe the Issue

In the “Binary Logical Operators” section, the summary says ?? returns a value only when the first operand is null or undefined. That leaves learners without an explanation for 0 ?? 7. The example defines volume: 0 and notifications: false but only demonstrates the fallback case.

Affected Page

https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/challenges/english/blocks/review-javascript-math/6723c463e51a2d9b747d7529.md#binary-logical-operators

Your code

console.log(0 ?? 7);     // 0
console.log(false ?? 7); // false
console.log(null ?? 7);  // 7

Expected behavior

Explain that JavaScript returns the first operand when it has a non-nullish value, including 0 and false. Otherwise it evaluates and returns the second operand. The same section could clarify which operand && and || return.

Screenshots

No response

System

Verified the example values with Node.js. The wording is in the English curriculum.

Additional context

Opening this for curriculum triage following #71797. The earlier #63409 concerned a separate lecture.

Activity

  1. added
    scope: curriculum
    status: waiting triage
    on Nov 26, 2026
  2. FullStraing commented on Nov 26, 2026

    @FullStraing

    I'd like to work on this — opening a PR that corrects the ?? wording and extends the example to cover the non-nullish cases.

  3. added
    js v9 cert
    on Nov 27, 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

    js v9 certscope: curriculumstatus: waiting triage

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions