title: Store Javascript function result into variable
body: <p>I am doing the following:</p>
  
  <pre><code>elemDrop: function(elem) {
      return elem;
  },
  
  elemAddRel: function(json) {
  
      var elem = this.elemDrop;
  
      console.log(elem);
  
      $(elem.item[0]).addClass('showTab').attr('rel', json.pageId);
  
  },
  </code></pre>
  
  <p>However when i console.log 'elem', it just stores the entire function into a variable. How can i actually store the result of the function into the variable?</p>