Categories
JavaScript Answers

How to append an array to form data in JavaScript?

Spread the love

To append an array to form data in JavaScript, we call the append method.

For instance, we write

formData.append("tags", JSON.stringify(tags));

to call formData.append with the key and value of the entry.

The value is an array converted to a JSON string with JSON.stringify.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *