r/learnjavascript • u/Distinct-Gene926 • Jul 27 '26
what's one JavaScript mistake every beginner should avoid?
If you could give one piece of advice to someone learning JavaScript today, what would it be?
It could be about:
- Learning fundamentals
- Debugging
- Async code
- DOM manipulation
- Functions
- Projects
Curious to hear what experienced developers wish they'd known earlier.
83
Upvotes
View all comments
Show parent comment
1
u/remain-beige Jul 28 '26
Please avoid using Var now (never use it) and now use Let or Const as variable declarations.
Const is ‘Constant’ and will warn you or prevent you from changing this value.
Let is for variables that will change value.
Another tip is to try and avoid changing a variables value overly much and instead declare another variable to mutate out any changes, such as formatting or calculation. If this gets too involved then break this out into a helper function.
This will help with debugging.