title: Asynchronous string concatenation with Node.js
body: <p>I have a function that generates filenames using the data and time. In the code below, I concatenate the date and time together in separate statements. If I run the code as so below, will the fileName be returned before either the date or time can be concatenated? If I return everything in one line, will that ensure the filename will be complete before being returned?</p>
  
  <pre><code>function generateFileName()
  {
      var date = new Date();
  
      var fileName = "scoreboard-";
      //date
      fileName += date.getMonth()+'-'+date.getUTCDate()+'-'+date.getUTCFullYear()+'-';
      //time
      fileName += date.getHours()+'-'+date.getMinutes()+'-'+date.getSeconds();
  
      //return fileName;
  }
  </code></pre>