jslint: Moved function binding outside loops