Why can't one set an alias to document.getElementById()?
javascript
Solution
When you call `foo.bar()` then `this` is set to `foo` inside `bar` When you copy `foo.bar` to `window.bar` then call `window.bar()`, `this` is set to `window`.
`getElementById` has to operate on a DOM document object.
Problem
Possible Duplicate: JavaScript function aliasing doesn't seem to work Set document.getElementById to variable Code would be more efficient if this was possible: ``` var min = document.getElementById; ``` and then call `document.getElementById()` using `min().` Not trying to write minified code but in this particular case one can reduce scope lookup and shorten some lines. Is this a syntax issue or a limiation on the language?