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;
}