René's URL Explorer Experiment


Title: closures - uninitialized vs undefined · Issue #3895 · javascript-tutorial/en.javascript.info · GitHub

Open Graph Title: closures - uninitialized vs undefined · Issue #3895 · javascript-tutorial/en.javascript.info

X Title: closures - uninitialized vs undefined · Issue #3895 · javascript-tutorial/en.javascript.info

Description: in this article, we are discussing lexical environments, and the scope of variables. upon initialization, variables are defined as because "the engine knows about the variable, but it cannot be referenced until it has been ...

Open Graph Description: in this article, we are discussing lexical environments, and the scope of variables. upon initialization, variables are defined as because "the engine knows about the variable, but it...

X Description: in this article, we are discussing lexical environments, and the scope of variables. upon initialization, variables are defined as <unitialized> because "the engine knows about the varia...

Opengraph URL: https://github.com/javascript-tutorial/en.javascript.info/issues/3895

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"closures - uninitialized vs undefined","articleBody":"in [this article](https://javascript.info/closure), we are discussing lexical environments, and the scope of variables. \nupon initialization, variables are defined as `\u003cunitialized>` because \"[the engine knows about the variable, but it cannot be referenced until it has been declared with `let`](https://javascript.info/closure#step-1-variables)\"\n\n\u003cimg width=\"640\" height=\"181\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/5f1df08d-5c9a-4fcd-9145-3d851ec9736b\" />\n\n\u003cimg width=\"577\" height=\"168\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/67fe9294-305a-4e86-a2a2-ffbf7d7a715e\" />\n\nlater in the article, when referencing nested lexical environments in functions, a variable is initialized as `undefined`. from my understanding, this is incorrect, as the engine knows about the variable, but is not referenced yet since it hasn't been declared.\n\n\u003cimg width=\"738\" height=\"181\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/70efb1f1-81a4-4fae-8ea2-31c708084984\" />\n\n\u003cimg width=\"808\" height=\"183\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/85378e91-356c-42a6-bbac-372ce2bc5c9b\" />\n\ni believe that we need to change the following SVG's to reflect this change:\nhttps://github.com/javascript-tutorial/en.javascript.info/blob/master/1-js/06-advanced-functions/03-closure/lexenv-nested-makecounter-2.svg\nhttps://github.com/javascript-tutorial/en.javascript.info/blob/master/1-js/06-advanced-functions/03-closure/lexenv-nested-makecounter-3.svg\n\n\nif this is an incorrect assumption, please help me understand why it's undefined instead of uninitialized! i'd love to learn more about how this all works.","author":{"url":"https://github.com/aredmondd","@type":"Person","name":"aredmondd"},"datePublished":"2025-10-17T12:18:26Z","url":"https://github.com/javascript-tutorial/en.javascript.info/issues/3895"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:15eba3c8-8873-94af-bb8c-72b8e165e174
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8B9E:2668B6:A965BD:E78241:6AFBDB60
html-safe-nonce8797e70833ff9a83727f59535516366d98141f53ba60a2706fe2e5f12542f3d1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjlFOjI2NjhCNjpBOTY1QkQ6RTc4MjQxOjZBRkJEQjYwIiwidmlzaXRvcl9pZCI6IjM3MTMwNjUzOTc0NTMwNTI3NjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac8065dc6b3d3178186566529308ec5044962a9c29a5b93bde90b859841b294942
hovercard-subject-tagissue:3525933418
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/javascript-tutorial/en.javascript.info/3895/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c4d2e7660344edbb0413aa02966a4efa6614f2ffd683fdf83ce1eb5f99659d7b/javascript-tutorial/en.javascript.info/issues/3895
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c4d2e7660344edbb0413aa02966a4efa6614f2ffd683fdf83ce1eb5f99659d7b/javascript-tutorial/en.javascript.info/issues/3895
og:image:altin this article, we are discussing lexical environments, and the scope of variables. upon initialization, variables are defined as because "the engine knows about the variable, but it...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamearedmondd
hostnamegithub.com
expected-hostnamegithub.com
None18742cb872ec73544356e60359266b67aafece70c4ce008042e06227924cdd07
turbo-cache-controlno-preview
go-importgithub.com/javascript-tutorial/en.javascript.info git https://github.com/javascript-tutorial/en.javascript.info.git
octolytics-dimension-user_id49552305
octolytics-dimension-user_loginjavascript-tutorial
octolytics-dimension-repository_id93253246
octolytics-dimension-repository_nwojavascript-tutorial/en.javascript.info
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id93253246
octolytics-dimension-repository_network_root_nwojavascript-tutorial/en.javascript.info
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release820be804f18e1ef3940bd74a00d41d73d02e2b91
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/javascript-tutorial/en.javascript.info/issues/3895#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fjavascript-tutorial%2Fen.javascript.info%2Fissues%2F3895
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fjavascript-tutorial%2Fen.javascript.info%2Fissues%2F3895
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=javascript-tutorial%2Fen.javascript.info
Reloadhttps://github.com/javascript-tutorial/en.javascript.info/issues/3895
Reloadhttps://github.com/javascript-tutorial/en.javascript.info/issues/3895
Reloadhttps://github.com/javascript-tutorial/en.javascript.info/issues/3895
javascript-tutorialhttps://github.com/javascript-tutorial
en.javascript.infohttps://github.com/javascript-tutorial/en.javascript.info
Codehttps://github.com/javascript-tutorial/en.javascript.info
Issues252 (252)https://github.com/javascript-tutorial/en.javascript.info/issues
Pull requests289 (289)https://github.com/javascript-tutorial/en.javascript.info/pulls
Discussionshttps://github.com/javascript-tutorial/en.javascript.info/discussions
Actionshttps://github.com/javascript-tutorial/en.javascript.info/actions
Security and qualityhttps://github.com/javascript-tutorial/en.javascript.info/security
Insightshttps://github.com/javascript-tutorial/en.javascript.info/pulse
https://github.com/javascript-tutorial/en.javascript.info
New issuehttps://github.com/login?return_to=https://github.com/javascript-tutorial/en.javascript.info/issues/3895
New issuehttps://github.com/login?return_to=https://github.com/javascript-tutorial/en.javascript.info/issues/3895
closures - uninitialized vs undefinedhttps://github.com/javascript-tutorial/en.javascript.info/issues/3895#top
https://github.com/aredmondd
aredmonddhttps://github.com/aredmondd
on Oct 17, 2025https://github.com/javascript-tutorial/en.javascript.info/issues/3895#issue-3525933418
this articlehttps://javascript.info/closure
the engine knows about the variable, but it cannot be referenced until it has been declared with lethttps://javascript.info/closure#step-1-variables
https://private-user-images.githubusercontent.com/94017614/502559350-5f1df08d-5c9a-4fcd-9145-3d851ec9736b.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIu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T1pbWFnZSUyRnBuZyJ9.hZya6-AseOtZak1KkUM6qPGIw15-1UzAQdcugQUFJSk
https://private-user-images.githubusercontent.com/94017614/502563254-85378e91-356c-42a6-bbac-372ce2bc5c9b.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTQ4OTA4OTIsIm5iZiI6MTc5NDg5MDU5MiwicGF0aCI6Ii85NDAxNzYxNC81MDI1NjMyNTQtODUzNzhlOTEtMzU2Yy00MmE2LWJiYWMtMzcyY2UyYmM1YzliLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjExMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYxMTE3VDA0NDMxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZmYzY0N2E4NmQxMTQ0MTA0ZTg4YWYwMWYyY2NlZTcwYzVjNmE5Njk3ZTM4NjE0MTk1ZjIzN2I4ZjgwOTc5YjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.GvKNRPY4X0lriUqt3iFCpH77pTVE6QUkDpVBuyp_gZE
https://github.com/javascript-tutorial/en.javascript.info/blob/master/1-js/06-advanced-functions/03-closure/lexenv-nested-makecounter-2.svghttps://github.com/javascript-tutorial/en.javascript.info/blob/master/1-js/06-advanced-functions/03-closure/lexenv-nested-makecounter-2.svg
https://github.com/javascript-tutorial/en.javascript.info/blob/master/1-js/06-advanced-functions/03-closure/lexenv-nested-makecounter-3.svghttps://github.com/javascript-tutorial/en.javascript.info/blob/master/1-js/06-advanced-functions/03-closure/lexenv-nested-makecounter-3.svg
https://github.com/joaquinelio
joaquineliohttps://github.com/joaquinelio
on Oct 19, 2025https://github.com/javascript-tutorial/en.javascript.info/issues/3895#issuecomment-3419760370
https://github.com/sujayhegde23
sujayhegde23https://github.com/sujayhegde23
on Jul 9, 2026https://github.com/javascript-tutorial/en.javascript.info/issues/3895#issuecomment-4926345945
@aredmonddhttps://github.com/aredmondd
Sign up for freehttps://github.com/signup?return_to=https://github.com/javascript-tutorial/en.javascript.info/issues/3895
Sign in to commenthttps://github.com/login?return_to=https://github.com/javascript-tutorial/en.javascript.info/issues/3895
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.