title: What is a real-world use-case for JavaScript's void operator?
body: <p>Why would someone write:</p>
  
  <pre><code>function () {
      if (err) {
          return void console.log(err)
      }
  }
  </code></pre>
  
  <p>instead of:</p>
  
  <pre><code>function () {
      if (err) {
          console.log(err)
          return
      }
  }
  </code></pre>
  
  <p>Has anyone used the <code>void</code> operator at all? I have seen it being used as in the example case above, but very very rarely.</p>
  
  <p><strong>Update</strong></p>
  
  <p><code>console.log</code> might be a poor example as it returns <code>void</code> itself. Let me show another use I have seen in an <code>express</code> app:</p>
  
  <pre><code>function (req, res) {
      ...
      // Some error occurred
      if (err) {
          return void res.send(foo)
          // `send` returns a `Response` instance
      }
  }
  </code></pre>
  
  <p>In <code>eslint</code>'s source code for example, it is being used quite a lot:</p>
  
  <blockquote>
    <p><a href="https://github.com/eslint/eslint/blob/master/lib/config/config-initializer.js#L351" rel="noreferrer">config-initializer.js</a></p>
    
    <p><a href="https://github.com/eslint/eslint/blob/master/tests/performance/jshint.js#L7428" rel="noreferrer">jshint.js - BIG FILE WARNING!</a></p>
    
    <p><a href="https://github.com/eslint/eslint/blob/master/tests/lib/rules/consistent-return.js#L35" rel="noreferrer">consistent-return.js</a></p>
  </blockquote>