title: Node.js Promises Run Without Being Called
body: <p>When using promises, they run automatically without being called. I followed the MDN Docs on setting them up, and they run when they are declared, without being prompted. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var progressPromise = new Promise(function(resolve, reject) {
    // Query the DB to receive the ToDo tasks
    // inProgress is the tableID
  
    getTasks(inProgress, function(tasks) {
      // Check that the list is returned.
      console.log("Shouldn't Run Automatically");
      if (tasks) {
        console.log("This Too Runs Automatically");
        resolve(tasks);
      } else {
        reject("There was a failure, the data was not received");
      }
    });
  
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;p&gt;Console Output&lt;/p&gt;
  &lt;p&gt; Shouldn't Run Automatically &lt;/p&gt;
  &lt;p&gt; This too runs automatically &lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I've checked the remaining code, only the promises trigger when I start the app with <code>node index.js</code></p>
  
  <p>Is this by design, or is my implementation wrong? If it's by design it would be great if you could link me to the docs, because I was unable to find anything on it. </p>
  
  <p>Thank you!</p>