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

124
Vistas
Filter Array - if the array exists in the array of objects

How Do I filter an array by checking if an array is listed in the array?

cryptoData: Array(100) 0: {CoinInfo: {…}, RAW: {…}, DISPLAY: {…}}

I am trying to check if cryptoData (Array) contains the DISPLAY array and if it does not contain DISPLAY - remove it from the cryptoData array and set the filterArray with only the elements that contain the DISPLAY Array.

My attempt:

var filterdArray = cryptoData.filter(function (el) {
  return cryptoData[el] === 'DISPLAY';
});

this.setState({
  cryptos: filterdArray,
  refreshing: false,
});
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

As the value is an object you can use hasOwnProperty to check if the object has a property.

var filterdArray = cryptoData.filter(function (el) {
  return el.hasOwnProperty('DISPLAY');
});

this.setState({
  cryptos: filterdArray,
  refreshing: false,
});
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