var form = document.querySelector('form');
var data = new FormData(form);
const serialize = (formElement) => {
let data = new FormData(formElement);
let obj = {};
for (let [key, value] of data) {
obj[key] = value;
}
return obj;
}
function objectifyForm(formArray) {//serialize data function
var returnArray = {};
for (var i = 0; i < formArray.length; i++){
returnArray[formArray[i]['name']] = formArray[i]['value'];
}
return returnArray;
}