Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.

Well done!

You have completed (UPI) Chapter 7: Advanced JavaScript Object Handling!

Instruction

Own Properties vs. Inherited Properties

Objects created using a constructor like Person have two types of properties:

  1. Own Properties: These are properties directly defined on the object (e.g., name).
  2. Inherited Properties: These are properties inherited from the prototype (e.g., greet()).

You can check if a property is an own property using Object.hasOwn():

const irma = new Person("Irma");
console.lo...