title: Javascript function in an object/hash
body: <p>I can call a function directly (I'll use <code>alert</code> as an example) like so</p>
  
  <pre><code>alert("Hello World!");  // pops up an alert window
  </code></pre>
  
  <p>However, when I put a function in an object, calling it no longer works:</p>
  
  <pre><code>d = {func: alert};
  d.func("Hello World!");    // doesn't do anything
  d["func"]("Hello World!"); // also doesn't do anything
  </code></pre>
  
  <p>I figured maybe I needed to explicitly pass in a blank <code>this</code> argument, so I tried</p>
  
  <pre><code>d.func(null, "Hello World!") // still nothing
  </code></pre>
  
  <p>but to no avail.  Interestingly, this does work</p>
  
  <pre><code>d.func.apply(null, ["Hello World!"]);  // success!
  </code></pre>
  
  <p>but that's so gratuitously verbose it makes my teeth hurt (to quote JWZ).  Is there a more concise, less ugly way?</p>