title: How can I break loop from callback function in node js?
body: <p>I have asynchronous query in Node.js. Variable <code>sq3</code> is a connection variable.
  For example something like this:</p>
  
  <pre><code>for (var i in res) {
    if (i == 1) {
      sq3.query("SELECT * from students;",
  
        function (err, res) {
          if (err) {
            throw err;
          } else {
            if (res.length == 1) {
              //do something
            } else {
              //break for
            }
          }
        });
  
      sq3.end();
    }
  }
  </code></pre>
  
  <p>How can I break from callback function?
  Thanks</p>