title: "this" keyword in meteor template
body: <p>I'm working through Discover Meteor and have come upon some code I'm not quite clear on. Here is my template and related js</p>
  
  <pre><code>&lt;template name="postItem"&gt;
    &lt;div class="post"&gt;
      &lt;div class="post-content"&gt;
        &lt;h3&gt;&lt;a href="{{url}}"&gt;{{title}}&lt;/a&gt;&lt;span&gt;{{domain}}&lt;/span&gt;&lt;/h3&gt;
        &lt;p&gt;
          submitted by {{author}}
          {{#if ownPost}}&lt;a href="{{postEditPath this}}"&gt;Edit&lt;/a&gt;{{/if}}
        &lt;/p&gt;
      &lt;/div&gt;
      &lt;a href="{{postPagePath this}}" class="discuss btn"&gt;Discuss&lt;/a&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  
  Template.postItem.helpers({
    ownPost: function(){
      return this.userId == Meteor.userId();
    },
    domain: function() {
      var a = document.createElement('a');
      a.href = this.url;
      return a.hostname;
    }
  });
  </code></pre>
  
  <p>In general I'm a little unclear on how "this" is working in the context of this js. I understand "this" to be the “owner” of the function we're executing, or rather, to the object that a function is a method of per <a href="http://www.quirksmode.org/js/this.html" rel="nofollow">the quirksmode article</a>, but I'm not really understanding this chain in the context of how meteor is implementing it. Just looking at the code, I'd expect this.userId to be null. Can someone help me or point me at some docs that explain how "this" works in Meteor?</p>