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

168
Vistas
How mapping specific property from arraylist

I m looking a way to get all email property from my postList list to filtering max chars authorized, the problme is i don't know really how mapping email property from postList...

const postList = [
 {"postId": 1, "id": 1, "email": "Eliseo@gardner.biz"},
 {"postId": 1, "id": 2, "email": "Jayne_Kuhic@sydney.com"},
 {"postId": 1, "id": 3, "email": "Nikita@garfield.biz"},
 {"postId": 1, "id": 4, "email": "Lew@alysha.tv"},
]

const onlyEmailValid = []

for (let i = 0; i < postList.length; i++) {
   if(postList.email.value.length > max_chars) {
     console.log("email : " + postList.email + " has too long");
       continue
     }
      
     onlyEmailValid.push(postList[i]);
}
console.log(clearJobList);
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Hello try to use filter method

const postList = [
 {"postId": 1, "id": 1, "email": "Eliseo@gardner.biz"},
 {"postId": 1, "id": 2, "email": "Jayne_Kuhic@sydney.com"},
 {"postId": 1, "id": 3, "email": "Nikita@garfield.biz"},
 {"postId": 1, "id": 4, "email": "Lew@alysha.tv"},
]

const onlyEmailValid = []
const max_chars = 13
postList.filter(item=>{
    (item.email.length > max_chars) ? console.log("email : " + item.email + " has too long") : onlyEmailValid.push(item);
})

console.log(onlyEmailValid);

about 4 years ago · Juan Pablo Isaza Denunciar

0

const postList = [
 {"postId": 1, "id": 1, "email": "Eliseo@gardner.biz"},
 {"postId": 1, "id": 2, "email": "Jayne_Kuhic@sydney.com"},
 {"postId": 1, "id": 3, "email": "Nikita@garfield.biz"},
 {"postId": 1, "id": 4, "email": "Lew@alysha.tv"},
]

const onlyEmailValid = []
const max_chars = 15 //example
for (let i = 0; i < postList.length; i++) {
   if(postList[i].email.length > max_chars) {
     console.log("email : " + postList[i].email + " has too long");
       continue
     }
      
     onlyEmailValid.push(postList[i]);
}
console.log(onlyEmailValid);

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