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

150
Vistas
Most efficient way to find if array contains specific element

I need a function that returns true/false if the array contains specific element or not. There are some functions such:

arr.includes(element)

that is not support IE 11.

arr.some(el => el === element)
arr.filter(el => el === element)[0]

that are supported IE 11.

But what are the best solution? Is there any more efficient way for instance by using binary search? Or any of those work with approximately perfect efficient? Any little contribution for efficient with wider browser support is attractive.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I think the best way for IE 11 :

function include(arr,obj) {
    return (arr.indexOf(obj) != -1);
}
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