title: What is the better way to split Date string in JavaScript?
body: <p>I am getting from api xml data, where one of the xml elements is date time, which nodeValue is always in this format - string: "YYYY-MM-DD". (<em>I can not request from api, to return me date time in diffrent format</em>)</p>
  
  <p>My problem is to split and convert this format into this string: "DD.MM.YYYY"</p>
  
  <p>Basicly I did this:</p>
  
  <pre><code>var myString = "2015-04-10"; //xml nodeValue from time element
  var array = new Array();
  
  //split string and store it into array
  array = myString.split('-');
  
  //from array concatenate into new date string format: "DD.MM.YYYY"
  var newDate = (array[2] + "." + array[1] + "." + array[0]);
  
  console.log(newDate);
  </code></pre>
  
  <p>Here is jsfiddle: <a href="http://jsfiddle.net/wyxvbywf/" rel="nofollow">http://jsfiddle.net/wyxvbywf/</a></p>
  
  <p>Now, this code works, but my question is: Is there a way to get same result in fewer steps?</p>