Answers for "How to convert FormData (HTML5 object) to JSON"

CSS
1

FormData to json

var object = {};
formData.forEach(function(value, key){
    object[key] = value;
});
var json = JSON.stringify(object);

// Or ES6 arrow function
var object = {};
formData.forEach((value, key) => object[key] = value);
var json = JSON.stringify(object);
Posted by: Guest on December-12-2020
0

How to convert FormData (HTML5 object) to JSON

var object = {};
formData.forEach(function(value, key){
    object[key] = value;
});
var json = JSON.stringify(object);
Posted by: Guest on June-12-2021

Code answers related to "How to convert FormData (HTML5 object) to JSON"

Browse Popular Code Answers by Language