title: KO: Computed observable of variabble which is not used in function
body: <p>I have three observable objects as stated below: </p>
  
  <pre><code>self.firstName = ko.observable();
  self.lastName = ko.observable();
  self.middleName = ko.observable();
  </code></pre>
  
  <p>And than I have <code>computed observable</code> as shown below: </p>
  
  <pre><code>ko.computed(function() {
     var myMiddleName = self.middleName();
     var Id = self.generateId(self.firstName.peek(), self.lastName.peek());
     /* Other Operation */
  });
  </code></pre>
  
  <p>As you see in above code, I am invoking computed function when value of the <code>middleName</code> changes. So I have assigned it to temporary variable called <code>myMiddleName</code> which is actually not used anywhere. Only just to invoke. </p>
  
  <p>So far everything works fine. But when I run <code>grunt lint</code> command it gives me an  error </p>
  
  <blockquote>
    <p>'myMiddleName' is assigned a value but never used. (no-unused-vars)</p>
  </blockquote>
  
  <p>So how can I get rid of this error ? </p>
  
  <p><strong>Update - 1</strong></p>
  
  <p>after removing variable <code>myMiddleName</code> as shown, warning doesn't appear. Is this correct way ? </p>
  
  <pre><code>ko.computed(function() {
     self.middleName();
     var Id = self.generateId(self.firstName.peek(), self.lastName.peek());
     /* Other Operation */
  });
  </code></pre>