title: NodeJS - How can I check if a MySQL result is undefined/empty?
body: <p>Does anyone know how to check if a NodeJS MySQL result is null/empty? What I'm trying to do is (very succinctly explained) to check if result 5 is empty or not, and if it's not, then execute an action (console.log in this case).</p>
  <p>This is the code without all the details, to simplify things, but when executing it I get that &quot;result&quot; is not defined</p>
  <pre class="lang-js prettyprint-override"><code>           con.query(&quot;SELECT tag, message FROM list1&quot;, function (err, result) {
              if (err) {
                console.log('Error: ' + err)
              }
            });
          
            if(!result[5] == undefined) {
                console.log('Result 5 exists')
            }
  </code></pre>