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

251
Views
¿Cómo filtro según la palabra clave coincidente?

¿Cómo filtro si el encabezado y el contenido contienen una palabra clave coincidente (ejemplo: inicio de sesión) y extraigo las pestañas que tienen esa palabra clave pero el nombre de categoría seguirá estando allí?

 export cons Tab = { categoryName: "Account Management", tabs: [ { header: "How to login?", content: "You need to go to the portal..", }, { header: "How to forget password?", content: "Click on "Forgot password", }, ] }

Ejemplo de salida cuando la palabra clave es "iniciar sesión":

 export cons Tab = { categoryName: "Account Management", tabs: [ { header: "How to login?", content: "You need to go to the portal..", }, ] }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

 const Tab = { categoryName: "Account Management", tabs: [ { header: "How to login?", content: "You need to go to the portal..", }, { header: "How to forget password?", content: "Click on Forgot password", } ] } const filterWithKeyword=(keyword)=>{ Tab.tabs= Tab.tabs.filter(t => t.header.indexOf(keyword)!==-1); } filterWithKeyword("login"); console.log(Tab);

También podemos usar indexOf en lugar de include.

about 4 years ago · Juan Pablo Isaza Report
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!