Reindenting files helps keep code neat. In Vim, you can reindent an entire file from normal mode (press
ESC to get there) by typing
:ar *.js :argdo norm gg=G :wall
You can find more information about those commands with
:h like this:
See the Vim wiki for more ideas.