Personally I used const wherever possible. I use let where I need mutability, but find that its often a sign that I need to rethink what I'm doing, and I pretty much pretend that var doesn't exist.
Both hoisting and the fact that var is function scoped rather than block scoped adds a lot of unnecessary complexity to reasoning about my code. let and const make code much less ambiguous.
I've been seriously coding in JS pretty much since ES6 became mainstream and I have not once found a time when I needed to use var to do anything I needed to do.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Personally I used
const
wherever possible. I uselet
where I need mutability, but find that its often a sign that I need to rethink what I'm doing, and I pretty much pretend thatvar
doesn't exist.Both hoisting and the fact that
var
is function scoped rather than block scoped adds a lot of unnecessary complexity to reasoning about my code.let
andconst
make code much less ambiguous.I've been seriously coding in JS pretty much since ES6 became mainstream and I have not once found a time when I needed to use
var
to do anything I needed to do.