title: What is the JavaScript convention for no operation?
body: <p>What is the JavaScript convention for no operation? Like a Python <code>pass</code> command.</p>
  
  <ul>
  <li>One option is simply an empty function: <code>function() {}</code></li>
  <li>jQuery offers <code>$.noop()</code>, which simply calls the empty function above.</li>
  <li>Is it acceptable to simply enter a value of <code>false</code> or <code>0</code>?  </li>
  </ul>
  
  <p>In context... all of these work without throwing an error in Chrome:</p>
  
  <pre><code>var a = 2;
  (a === 1) ? alert(1) : function() {};
  (a === 1) ? alert(1) : $.noop();
  (a === 1) ? alert(1) : false;
  (a === 1) ? alert(1) : 0;
  </code></pre>
  
  <p>EDIT: A lot of people responded with, "don't do this! Change the code structure!" This reminds me of a post where someone asked how to sniff the browser. He received a barrage of posts saying, "DON'T DO THAT! IT'S EVIL," but <em>nobody told him how to sniff the browser</em>.  This is not a code review. Imagine that you are dealing with legacy code that can't be changed, and without some function passed in, it will toss an error. Or, simply, that's the way the customer wants it, and <em>they're paying me</em>. So, respectfully, please <strong>answer the question</strong>: What is the best way to specify a "no operation" function in JavaScript?</p>
  
  <p>EDIT2: How about one of these?</p>
  
  <pre><code>true;
  false;
  0;
  1;
  null;
  </code></pre>