-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Variables tutorial mentions var, but examples use const without explanation #864
Copy link
Copy link
Open
Description
Issue
In the Variables and Types tutorial, it states that variables are defined using the var keyword. However, the examples immediately use const, which can be confusing for new learners.
> js
> const myNumber = 3; // a number
> const myString = "Hello, World!" // a string
> const myBoolean = true; // a boolean
> Expected Behavior
Expected Behavior
It would be helpful to include a short explanation clarifying why const is used instead of var, especially for beginners.
For example:
that const and let are modern JavaScript best practices
that var is older and generally discouraged in new code
or that const is preferred when a variable does not need to be reassigned
This small clarification would improve consistency and reduce confusion for new learners.
Screenshot
Tutorial Link
https://www.learn-js.org/en/Variables_and_Types
Thank you
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels