JavaScript var ignores block scope
var is function-scoped, so declarations inside blocks can overwrite values unexpectedly. Use let or const for block-local state.
- @imsa-mehta▲ 5
Clear note on javascript / scope. "JavaScript var ignores block scope" is the kind of detail that is easy to overlook.
Good to see "JavaScript var ignores block scope" written down. Handy reference for anyone working with javascript / scope.
Elegant
Remarkable
Bookmarked
- @deneil2121▲ 4
Insightful
Wise
Refined
- @ohmshawas23▲ 3
Productive
Important
- @deneil2121▲ 3
Sensible
- @narwhalix▲ 2
Elegant
- @ohmshawas23▲ 2
Agreed
Appreciate the write-up on "JavaScript var ignores block scope". Useful for anyone using javascript / scope.
- @hk3narwhal▲ 1
Clever
- @mrnarwhal55▲ 1
Fundamental
Insightful
Clear note on javascript / scope. "JavaScript var ignores block scope" is the kind of detail that is easy to overlook.
Clear note on javascript / scope. "JavaScript var ignores block scope" is the kind of detail that is easy to overlook.
Appreciate the write-up on "JavaScript var ignores block scope". Useful for anyone using javascript / scope.
Specific and to the point: "JavaScript var ignores block scope". Worth a look if you touch javascript / scope.
"JavaScript var ignores block scope" is a useful thing to know about with javascript / scope. Thanks for sharing it.
Fixed
Fantastic