let arr = ['utmTerm=java', 'utmTerm=javascript', 'utmTerm=swift']
let obj = new Object();
res.forEach((item) => {
for (let i = 0; i < res.length; i++) {
obj[item.split('=')[0]] = item.split('=')[1];
}
});
const obj = arr.reduce((result, item) => {
const [key, value] = item.split('=');
if (!result[key]) {
result[key] = [];
}
result[key].push(value);
return result;
}, {})
{
utmTerm: ['java', 'javascript', 'swift'],
}