I am trying to Push key-value pair in an Array in a loop.
var arr_ReservationType = new Array();
$("#table tr").each(function()
{
arr_ReservationType=
{
key: "value"
}
});
I have also tried
arr_ReservationType[index].push({key:"value"});
and
arr_ReservationType[index].push({key:"value"});
index++;
});
But all these codes are adding an object to the array, not the key-value pair.
I am not able to find the exact solution to my problem. Please suggest if there is a similar solution available or any alternate solution. Thanks.