Soy un poco nuevo en esto, pero esto me está dando un dolor de cabeza. Heres mi código lo que estoy tratando de resolver:
function parseComponents(data: any, excelAttributesArray: string[]) { let confs = ""; let isValues = false; let listValues = ""; if (!data) return confs; if (data["Part"]) { const part = data["Part"]; excelAttributesArray.forEach((attribute) => { let attributeValue = part[attribute]; if (attributeValue !== null) isValues = true; if (attributeValue !== null && attributeValue.Value) { attributeValue = attributeValue.Value; } listValues += attributeValue + ","; }); const number = part["Number"]; if (isValues) { confs += `${listValues}${number}`; } } if (data["Components"] && data["Components"].length > 0) { for (let i = 0; i < data["Components"].length; i++) { const tmp = parseComponents( data["Components"][i], excelAttributesArray ); if (tmp && tmp.length > 0) confs += (confs.length > 0 ? "|" : "") + tmp; } } return confs; } El valor confs se devuelve como una cadena. ¿Cómo obtengo que regrese como matriz?