Currently I'm pushing multiple inputs to a array but this is a lot of repeating code, how can I improve this?
var tickets = [];
$('.js-ticket').each(function(){
var ticket = [];
ticket.push($("input[name='ticket_naam\\[\\]']").map(function(){return $(this).val();}).get());
ticket.push($("input[name='ticket_aantal\\[\\]']").map(function(){return $(this).val();}).get());
ticket.push($("input[name='ticket_prijs\\[\\]']").map(function(){return $(this).val();}).get());
ticket.push($("input[name='ticket_begin_datum\\[\\]']").map(function(){return $(this).val();}).get());
ticket.push($("input[name='ticket_begin_tijd\\[\\]']").map(function(){return $(this).val();}).get());
ticket.push($("input[name='ticket_eind_datum\\[\\]']").map(function(){return $(this).val();}).get());
ticket.push($("input[name='ticket_eind_tijd\\[\\]']").map(function(){return $(this).val();}).get());
ticket.push($("input[name='ticket_aanal_max\\[\\]']").map(function(){return $(this).val();}).get());
ticket.push($("input[name='ticket_aanal_min\\[\\]']").map(function(){return $(this).val();}).get());
tickets.push(ticket);
});
historyVar['tickets'] = tickets;
});
The Html is reader simple just 9 input fields and i'm running this part on a click of a button