title: Sailsjs - Continue executing after return res.json();
body: <p>It continues execution even if the condition is true and return res.json() is executed.</p>
  
  <pre><code>_.each(rooms, function(room){
      if(room.users.length == users.length) {
          return res.json(room); // &lt;-- returns but still continuous execution
      }
  });
  </code></pre>
  
  <p>Below is the error printed in console.</p>
  
  <blockquote>
    <p>error: Error: Cannot write to response more than once</p>
  </blockquote>
  
  <p>Do I need to do anything else?</p>