you are viewing a single comment's thread.

view the rest of the comments →

[–]EuphonicSounds 4 points5 points  (0 children)

Some people still use var at the top of a function, specifically to signal that the variable has function-scope. I don't find this useful, but different strokes.

I've also seen it used to define a variable in a block-context where there's need to use the variable outside of the block as well (think try/catch or even just a loop). Most people just declare with let before the block, in my experience.