I am using Typeahead by twitter. I am running into this warning from Intellij. This is causing the \"window.location.href\" for each link to be the last item in my list of i
Since the only scoping that JavaScript has is function scope, you can simply move the closure to an external function, outside of the scope you're in.