// Sample solution
var date = "2012-03-16";
// split the date by "-"
var date_as_array = date.split('-');
// reverse the order of elements in the array
var reversed_array = date_as_array.reverse();
// convert the reversed array back to a string using
// the join() method with "/" as separator
var converted_date = reversed_array.join('/');
No comments:
Post a Comment