score:1

for(const name in data) {
    if (Array.isArray(data[name]) {
        for (let i = 0; i < data[name].length; i++) {
            formData.append(name, data[name][i]);
        }
    } else {
        formData.append(name, data[name]);
    }
}

Related Query

More Query from same tag