Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

247
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!