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

250
Vistas
Why Object.getOwnPropertyDescriptors() does not work when I pass the history object (which is part of the BOM) to it?

There are different objects in the browser object model (BOM) such as history, location, document, etc. I can get the property descriptors for the location and the document objects but not for the history object. Why is that so?

enter image description here

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

0

Because the history object instance has no "own" properties. All of them are inherited from its prototype, which by definition are not included in Object.getOwn[anything] functions. You will also notice that Object.getOwnPropertyNames(history) is an empty array when you run it, telling us as much.

(Unlike location or document, which are objects with defineOwnProperty steps as part of their formal instantiation specification, history is an "empty" object with fairly special handling, but following the normal rules for object instantiation)

Instead, use Object.getOwnPropertyDescriptors(Object.getPrototypeOf(history)) if you want to see its "immediate" API.

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