JSFiddle - React, Tailwind, and code Playground
HTML
<form id ="myform">
<input type="text" name="options[0]" value="hey"/>
<input type="text" name="options[1]" value="how"/>
<input type="text" name="options[2]" value="are"/>
<input type="text" name="options[3]" value="you"/>
</form>
JavaScript
var serializedArray = $('#myform').serializeArray();
var customArray = {};
customArray['options'] = {};
for(key in serializedArray)
{
customArray['options'][key] = serializedArray[key]['value'];
}
console.log(customArray);