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

315
Views
Why don't these error properties show under keys?

It seems from Object.getOwnPropertyNames vs Object.keys, that the main difference between Object.keys() and Object.getOwnPropertyNames() is that the former only returns some of the properties -- those that are enumerable. So I'm wondering for something like an Error object, why it's decided that the properties aren't enumerable. For example:

try {
    let field="XYZ";
    field.a.b.c;
} catch (error) {
    console.log('111', Object.getOwnPropertyNames(error));
    console.log('222', Object.keys(error));
}

Why for example does the Error object not make those properties enumerable? When is a property usually made enumerable?

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