What is best way to convert date from JavaScript string in format YYYYMMDD to JavaScript date format.

```
var from_date = document.getElementById('from_date').value;             
var YYYY = from_date.substring(0,4);
var MM = from_date.substring(4,7);
var DD = from_date.substring(7,8);      

```