title: Knockout computer function cannot be evaluated
body: <p>Please check my plunkr here:</p>
  
  <p><a href="https://plnkr.co/edit/pwKohFTmLPW1BKNwHxWR?p=preview" rel="nofollow">https://plnkr.co/edit/pwKohFTmLPW1BKNwHxWR?p=preview</a></p>
  
  <p>I have a simple computer function:</p>
  
  <pre><code>self.SubscribersOrEmails = ko.computed(function() {
      var counter = 0;
      if (self.Emails != null &amp;&amp; self.Subscribers != null) {
          counter = self.Emails().length + self.Subscribers().length;
      }
      console.log("counter: " + counter);
      return counter;
  }, self);
  </code></pre>
  
  <p>When I get to use it like this:
  <code>self.SubscribersOrEmails()</code> then I get the error that <code>'SubscribersOrEmails is not a function'</code>
  but when I do <code>console.log(self.SubscribersOrEmails)</code> then it prints out a function. So it IS a function.
  How do I use it then? I want it to return an integer. Currently it returns a function, but I am not allowed to evaluate it.</p>
  
  <p>Any idea what is going on with it?</p>
  
  <h2>UPDATE</h2>
  
  <p>Some people have been seeing an old version of the plunkr for some bizarre reason.</p>
  
  <p>I can now see that it's a declaration order issue.
  If I do this:</p>
  
  <pre><code>self.SubscribersOrEmails = ko.computed(function() {
                var counter = 0;
                  if (self.Emails != null &amp;&amp; self.Subscribers != null) {
                      counter = self.Emails().length + self.Subscribers().length;
                  }
              console.log("counter: " + counter);
              return counter;
          }, self); 
  
   self.Subscribers = ko.observableArray().extend({ required: { onlyIf: function () { console.log(self.SubscribersOrEmails()); return self.SubscribersOrEmails === 0}, params: 'Subscribers', message: "Please either select a user or type email address(es)" } })
   self.Emails = ko.observableArray().extend({ required: { onlyIf: function () { return self.SubscribersOrEmails == 0 }, params: 'Emails' } })
  </code></pre>
  
  <p>Then the function works but Emails and Subscribers is always zero because they don't exist when they are read.</p>
  
  <p>If I do the opposite then the function doesn't exist.</p>
  
  <p>So all possible order declarations cause problems :(</p>