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

172
Views
Is inherited property the same as prototype property?

I am learning about the different types of properties an object can have in javascript (own properties, inherited properties, and prototype properties?)

I came across these two articles and I got kind of confused.

enter image description here

enter image description here

Are these two articles referring to the same thing?

When people say inherited properties do they mean prototype properties? Are these terms interchangeable?

How many different types of properties are there?

Thank you in advance! :)

Link to articles:

https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/object-oriented-programming/iterate-over-all-properties

https://attacomsian.com/blog/javascript-own-inherited-properties

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Yes, they're referring to the same thing.

In JavaScript, generally, if you can retrieve a value from an object by referencing a member - eg obj.someProp - then that member (someProp here) is either

  • A property directly on the instance itself, or
  • A property directly on one of the objects that the instance inherits from - on one of its prototypes

A given member reference is either one or the other (or it doesn't exist either on the instance or on any of the prototype objects, in which case it evaluates to undefined).

When people say inherited properties do they mean prototype properties? Are these terms interchangeable?

Mostly. It would be a bit more accurate to say that objects inherit from other objects ("prototypal inheritance"), and that referencing a property on a child object will evaluate to the property on the first parent object that has that property, if the child object does not have it. This section of the spec goes into more detail.

How many different types of properties are there?

Yes, properties can have different types - there are data properties and accessor properties, and properties may also be enumerable (or not), and/or configurable (or not) - but it would be misleading to say that these types are in the same category. The types I've just mentioned are property attributes, and every property directly on an object has some configuration of the above. Prototypal inheritance of properties is a different category - property attributes don't have any notion of inherited properties, because property attributes only refer to properties on an object itself.

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!