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

101
Vistas
Why does removeItem have the function added, but when the method is called, it returns undefined?
function Coll(items) {
    this.removeItem = items.pop
}
const coll = new Coll([2,4,6,8,10])
console.log(coll.removeItem())

If I make console.log(coll), I can see that there's a function inside of the object. If I call it, it retuns undefined. I know the solution to make it run properly is to add () => items.pop() but I still can't understand why. The main question here is what happens when I add the () => ...() to the method call

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