Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

188
Views
No todas las sentencias If de JavaScript se ejecutan

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());
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!