Dev HelpersOpen library
← Back

Replace duplicate fields in FormData

Replace duplicate fields in FormData in JavaScript.

Open this example in the interactive library

Source code

const form = new FormData();
form.append("tag", "css");
form.append("tag", "js");
form.set("tag", "python");
console.log([...form.entries()]);

Sample output

[ [ 'tag', 'python' ] ]