I have a table which has a date string in the header. It is returned as part of an array but I need that date in the array to be a Date Object and not just a string.
My table is as follows
// [[20th Jan, 33], [21st Jan, 44], [22nd Jan, 5],[23rd Jan, 17]]
I use the following JS to get this array
var arr = $.map($('#bookedTable th:not(:first)'), function(el,i) {
return [[$(el).text(), $('#bookedTable td:eq('+i+')').text()]]
});
console.log(arr)
Question: How can I return the string dates as date objects in my array?