Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

158
Vistas
Find all elements that returns false with the includes() method

I'm quite new to programming.

My use case : I want to find elements that matches this criteria (refer code sample below) as well as elements that doesn't match the criteria and store them in 2 separate variables. Is there any simple methods to do it?

Also I am not able find elements that returns false here. Can someone help me with this.

posts = response.data.posts.filter((m) =>
  m.post.toLowerCase().includes(searchQuery.toLowerCase())
);
about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Do, you want something like this?

let res = [{name: "Peter", age: 29}, {name:"Joseph", age: 23}, {name: "Lily", age: 17}, {name: "Robert", age: 33}, {name: "Ralph", age: 49}] 

let temp1=[];
let temp2=[];

 res.map((item) => item.age <=25 ? temp1.push(item) : temp2.push(item));
 console.log(temp1);
 console.log(temp2);

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda