Don't Make Functions Within a Loop

The jshint/jslint error “Don’t make functions within a loop” can be confusing. I explain why it can be a problem and what you can do instead.