Hello. Help build a json request structure.
I have already bothered to do all sorts of variations, I sit on it for the first time, so I ask for help.
There is a form, I make a sample from a form using serializeArray() . It's all okay, the structure is built right. Next, in addition to the data from the form, I need to send other data that will look like:
var myObj = { "flavors": [ {"id":"id", "value": "value"}, {"id":"id", "value": "value"} ], } How can I properly "cross" the data from the form and other data ( flavor[] )? How is it usually done? Maybe I'm just fixated on something incomprehensible, and everything is done much easier !? 
It does not quite work out as it should, I don’t know how best to combine the data so that it would be easier on the server to work with all the data .. I tried it this way ...
var myObj = { "flavors": [ {"id":"id", "value": "value"}, {"id":"id", "value": "value"} ], "form": [ ] }; var inputs_data = $(this).serializeArray(); myObj.form.push(inputs_data); 
var myObj = { "flavors": [], "form": [] };-myObj.form = inputs_data-myObj.form = inputs_data