title: JavaScript promises not passing data to .then unless I explicitly use Promise.resolve
body: <p>My code gets a translation from Google translate, pushes the translation into an array, and then passes the translation array to the next code block. Or it doesn't, depending on the syntax. This works:</p>
  
  <pre><code>translate.translate(text, target)
  .then(function(results) {
    translation = results[0];
    translationArray.push(translation);
    return Promise.resolve(translationArray);
  })
  .then(function(translationArray) {
    console.log(translationArray);
  </code></pre>
  
  <p>This code doesn't work:</p>
  
  <pre><code>translate.translate(text, target)
  .then(function(results) {
    translation = results[0];
    return translationArray.push(translation);
  })
  .then(function(translationArray) {
    console.log(translationArray);
  </code></pre>
  
  <p><code>translationArray</code> logs as <code>1</code>. What does <code>1</code> mean? Why do I need to explicitly use <code>Promise.resolve</code>?</p>
  
  <p>I tried this, it doesn't help:</p>
  
  <pre><code>const finalPromise = translate.translate(text, target)
  .then(function(results) {
     translation = results[0];
     return translationArray.push(translation);
    })
  .then(function(translationArray) {
     console.log(translationArray);
  </code></pre>