JSFiddle - React, Tailwind, and code Playground
JavaScript
function processArray(arr) {
let charges = [];
if (!Array.isArray(arr)) return charges;
for (let item of arr) {
charges.push('woot' + item);
}
return charges;
}
let test = ['cool'];
test.push(...processArray());
document.write(test);