title: How to concat string and number in Typescript
body: <p>I am using method to get data</p>
  
  <pre><code>function date() {
      let str = '';
  
      const currentTime = new Date();
      const year = currentTime.getFullYear();
      const month = currentTime.getMonth();
      const day = currentTime.getDate();
  
      const hours = currentTime.getHours();
      let minutes = currentTime.getMinutes();
      let seconds = currentTime.getSeconds();
      if (month &lt; 10) {
          //month = '0' + month;
      }
      if (minutes &lt; 10) {
          //minutes = '0' + minutes;
      }
      if (seconds &lt; 10) {
          //seconds = '0' + seconds;
      }
      str += year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds + ' ';
  
      console.log(str);
  }
  </code></pre>
  
  <p>And as output I get </p>
  
  <pre><code>2017-6-13 20:36:6 
  </code></pre>
  
  <p>I would like to get the same thing, but like </p>
  
  <pre><code>2017-06-13 20:36:06 
  </code></pre>
  
  <p>But if I try one of the lines, that I commented out, for example this one </p>
  
  <pre><code>month = '0' + month;
  </code></pre>
  
  <p>I get error</p>
  
  <pre><code>Argument of type 'string' is not assignable to parameter of type 'number'.
  </code></pre>
  
  <p>How could I concat string and number?</p>