If Javascript has first-class functions, why doesn't this work?
<p>Javascript is purported to have first-class functions, so this seems like the following ought to work:</p>

<pre><code>var f = document.getElementById;
var x = f('x');
</code></pre>

<p>But it fails on all browsers, with a different cryptic error message on each one.  Safari says "Type error".  Chrome says "Illegal invocation".  Firefox says "Could not convert Javascript argument."</p>

<p>Why?</p>
