-
Notifications
You must be signed in to change notification settings - Fork 305
Open
Labels
answered🎉 Yay! The issue has been resolved, or the question has been answered.🎉 Yay! The issue has been resolved, or the question has been answered.question
Description
Node.js Version
v24.14.0
NPM Version
v11.9.0
Operating System
Win11 25H2
Subsystem
constants
Description
I'm new to Node.js. All my previous experience with JavaScript is when it is browser-hosted.
Is there a node program control that disables the variable declaration requirement, so that variables can be implicitly declared when an assignment occurs (similar to browser-hosted implementations)?
Minimal Reproduction
file="one";
vs.
const file="one"; or var file="one";
Output
file="one";
^
ReferenceError: file is not defined
at file:///C:/Users/Public/npm/Sample-Const.js:1:5
at ModuleJob.run (node:internal/modules/esm/module_job:430:25)
at async onImport.tracePromise.proto (node:internal/modules/esm/loader:661:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5)
Node.js v24.14.0
Before You Submit
- I have looked for issues that already exist before submitting this
- My issue follows the guidelines in the README file, and follows the 'How to ask a good question' guide at https://stackoverflow.com/help/how-to-ask
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
answered🎉 Yay! The issue has been resolved, or the question has been answered.🎉 Yay! The issue has been resolved, or the question has been answered.question