Get rid of “Don't make functions within a loop” warning from JSHint.