I can see how it could be useful to declare a var within an if, for example, if that's the first place it is used, as you can in python, but I think using var inside for, for example, opens you up to weird bugs.
I agree that in principle it is possible to use var responsibly. I still prefer let, as I know it'll be gone when my scope changes, so I don't have to think about it any more.
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.
I can see how it could be useful to declare a
var
within anif
, for example, if that's the first place it is used, as you can in python, but I think usingvar
insidefor
, for example, opens you up to weird bugs.I agree that in principle it is possible to use
var
responsibly. I still preferlet
, as I know it'll be gone when my scope changes, so I don't have to think about it any more.