write a function that converts user entered date formatted as m/d/yyyy
function formatDate(userDate)
{
var parts = userDate.split('/');
if (parts[0].length == 1) parts[0] = '0' + parts[0];
if (parts[1].length == 1) parts[1] = '0' + parts[1];
return parts[2] + parts[0] + parts[1];
}
console.log(formatDate("12/10/2017"));