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

170
Vistas
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 Respuestas
Responde la pregunta

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 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