Skip to content

docs: correct 'undefined' to 'null' in callback example #8037

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 29, 2025

Conversation

pirateIV
Copy link
Contributor

@pirateIV pirateIV commented Jul 28, 2025

Description

The example comment shows undefined but logs null due to sync execution.

Validation

The original example claimed console.log('bar', bar) outputs undefined, but this is incorrect because:

  1. bar is explicitly initialized to null (let bar = null).
  2. The callback runs synchronously, so bar is still null when logged (the bar = 1 assignment happens later).

Related Issues

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

The example comment shows `undefined` but logs `null` due to sync execution.

Signed-off-by: Benjamin <127757412+pirateIV@users.noreply.github.com>
@pirateIV pirateIV requested a review from a team as a code owner July 28, 2025 01:57
Copy link

vercel bot commented Jul 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Jul 28, 2025 1:58am

@avivkeller avivkeller enabled auto-merge July 29, 2025 21:49
@avivkeller avivkeller added the github_actions:pull-request Trigger Pull Request Checks label Jul 29, 2025
@github-actions github-actions bot removed the github_actions:pull-request Trigger Pull Request Checks label Jul 29, 2025
Copy link
Contributor

github-actions bot commented Jul 29, 2025

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🟠 77 🟢 100 🟢 100 🟢 100 🔗
/en/about 🟢 100 🟢 97 🟢 100 🟠 88 🔗
/en/about/previous-releases 🟢 98 🟢 93 🟢 100 🟠 89 🔗
/en/download 🟢 93 🟢 100 🟢 100 🟢 100 🔗
/en/blog 🟢 100 🟢 100 🟢 96 🟢 100 🔗

Copy link

codecov bot commented Jul 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.04%. Comparing base (dd04024) to head (c709d50).
⚠️ Report is 11 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8037   +/-   ##
=======================================
  Coverage   73.04%   73.04%           
=======================================
  Files          95       95           
  Lines        8324     8324           
  Branches      214      214           
=======================================
  Hits         6080     6080           
  Misses       2243     2243           
  Partials        1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@avivkeller avivkeller added this pull request to the merge queue Jul 29, 2025
Merged via the queue into nodejs:main with commit b33a5a4 Jul 29, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants