Today I run into something unexpected when writing JavaScript in Chrome (version 37). It appears Chrome has a predefined focus
variable available as a global. Upon further inspection via developer tools, I've found that this variable is a function:
> typeof focus
"function"
Does anyone know what this function is or does, or why is it a global?
I had a variable named focus
and this global messed everything up in my webapp. I spent the last hour debugging where focus
was getting created and it turned out that Chrome had it predefined.