I want to customise an array to some types using jquery
$(function(){
let i = 1;
$('.dataTable thead th').each(function(index) {
let array = {
text:$(this).text(),
if($(this).hasClass("datepicker")) {
type:"number"
}
};
});
});
I want to say that if this has class datepicker so set the type:number
and else set the type:text