title: Calling a function in JavaScript without parentheses
body: <p>Is there a way in JavaScript to call a function without parentheses?</p>
  
  <p>For example in jQuery:</p>
  
  <p><code>$('#wrap').text("asdf");</code> will work and so will <code>$.ajax(ajaxOptions);</code></p>
  
  <p>I'm mapping a function (class) to <code>window.$</code> that has a set of functions I want to be able to call with or without parentheses. Like jQuery.</p>
  
  <p>Here's a code example:</p>
  
  <pre><code>function Test(asdf) {
    this.test = function(testVar) { return testVar + ' asdf'; }
  }
  </code></pre>
  
  <p>And I map <code>Test()</code> to <code>$</code>:</p>
  
  <pre><code>window.$ = new Test();
  </code></pre>
  
  <p>I have to call the function (class) like this:</p>
  
  <pre><code>$('asfd').test('ASDF');
  </code></pre>
  
  <p>But I want to be able to call it like this:</p>
  
  <pre><code>$.test('asdf');
  </code></pre>