No problem. It's a matter of jQuery, not JS per se. jQuery has these weird collection things it returns from selector calls, and they themselves provide `each`. jQuery's `each` is happy to iterate over empty selections (and do nothing). Modern JS engines are really fast (and smart), so there's no conditional compilation of the function declaration or anything to try to optimize away. Even in comparatively naive CPython, closures are compiled once, and the only thing that could happen at runtime is binding them to different sets of vars.