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

139
Views
¿Cómo puedo obtener solo elementos falsos de campos activos?

mi escenario

1: si hago clic en el botón, estoy filtrando la matriz por campo activo como falso y luego actualizando los campos como verdaderos.

2: si hago clic por segunda vez, quiero obtener objetos con solo campos activos falsos.

Resultado: Todos los elementos se están recibiendo.

El enlace JsFiddle está aquí

 const test =[ {firstName:'abc',lastName:'abc',active:false}, {firstName:'def',lastName:'def',active:false}, {firstName:'ghi',lastName:'ghi',active:false}, ] document.getElementById('btn').addEventListener('click',()=>{ const test2 = test.filter(x=>x.active ===false); console.log(test); test2.forEach(x=>{ x.active=true; }) })
 <button id="btn"> Get </button>

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!