It totaly makes sense to me to use it here.
What would be the alternative? How can i generaly avoid to use them and most of all why is it bad according to jsLint to make us
Globale variables could clash with other Scripts or be overwritten. When you don't need a global, it's advisable to avoid them. Simply use var (or let if your JS-Version-Support is greater than 1.7):