Tengo un programa que no establece una cadena. Tengo un montón de sentencias if que configuran una matriz con la función push, y eso funciona, pero la configuración de la cadena no funciona. De modo que el tipo primario de cadena siempre aparece vacío al final de todas las declaraciones if, pero la matriz está llena. No estoy seguro de por qué se está llenando la matriz y la Cadena no.
const doAllOfThis = async () => { var myTitleAndDescription = response.title.toLowerCase() + " " + response.description.toLowerCase(); myNumberOfShorts += (myTitleAndDescription.match(/shorts/g) || []).length; //response.title = response.title.toLowerCase(); //response.description = response.description.toLowerCase(); var myTitle = response.title.toLowerCase(); var myDescription = response.description.toLowerCase(); //(temp.match(/is/g) || []).length; if (myTitle.includes("slim") || myDescription.includes("slim") || myTitle.includes("skinny") || myDescription.includes("skinny") ){ myClothingKeywords.push("slim"); } if (myTitle.includes("polo") || myDescription.includes("polo")){ myClothingKeywords.push("polo"); primarytype = "shirt"; } if (myTitle.includes("flannel") || myDescription.includes("flannel")){ myClothingKeywords.push("flannel"); } if (myTitle.includes("t-shirt") || myDescription.includes("t-shirt") ||myTitle.includes("tshirt") || myDescription.includes("tshirt")){ myClothingKeywords.push("t-shirt"); primarytype = "shirt"; } if (myTitle.includes("jacket") || myDescription.includes("jacket")){ primarytype = "jacket"; myClothingKeywords.push("jacket"); } if (myTitle.includes("bomber") || myDescription.includes("bomber")){ myClothingKeywords.push("bomber"); } if (myTitle.includes("sweatshirt") || myDescription.includes("sweatshirt")){ myClothingKeywords.push("sweatshirt"); } if (myTitle.includes("pants") || myDescription.includes("pants")){ primarytype = "pants"; myClothingKeywords.push("pants"); } } const doBigOne = async () => { promises.push(await doAllOfThis()); } } } promises.push(await doBigOne());