How to dynamically pass parameter array in $.params

I am trying to send this input parameters in x-www-formurlencoded form :

customer_id,
xyz,
order_total,
order_location,
item_id[0]
item_quantity[0],
res_id,
item_id[1],
item_quantity[1]

Now my code for network request is as shown below:

return $http({
                method: "POST",
                headers: {
                    'Content-Type': 'application/x-www-form-urlencoded',
                    'Authorization': 'Bearer ' + user_token
                },
                url: config.server_url + "orders",
                data: $.param({
                    'customer_id': user_id,
                    'xyz': '',
                    'order_total': '50.09',
                    'order_location': 'abc',
                    'res_id': res_id,
                    'item_id[0]':'dkkdskds',
                    'item_quanitity[0]':1,
                    'item_id[1]':'dkkdskds',
                    'item_quanitity[1]':1,
                    'item_id[2]':'dkkdskds',
                    'item_quanitity[2]':1,
                })
            });

Now, I don’t know how to pass item_id[0],item_id[1],item_id[2],… dynamically.

Source: AngularJS