title: Javascript OR statement on call function from object
body: <p>I'll like to see if there is a name(it's a bad practice?) for this:</p>
  
  <pre><code>var callback = function(error, data) {
      var method = error ? 'handleError' : 'handleSuccess';
      object[method](error || data, action);
  };
  </code></pre>
  
  <p>If there's an error, object.handleError will use <em>error</em> and <em>action</em>, let say I dont care about any other param after <em>error</em>  if <em>error</em></p>
  
  <p>In the other hand, if there's no error, object.handleSuccess will use <em>data</em> and <em>action</em></p>