How to convert FormData to object?

Viewed 227

enter image description here

I'm using react and this data is in state. How to convert such data into normal object or array?

1 Answers

You can use the Object.fromEntries method

// data is an object with the values inside formData
let data = Object.fromEntries(formData.entries())
Related