To append an array to form data in JavaScript, we convert it into a JSON string.
For instance, we write
const tags = ["this", "is", "an", "array"];
formData.append("tags", JSON.stringify(tags));
to call append
with the key and the JSON array string converted from the tags
array.