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:
-
Own Properties: These are properties directly defined on the object (e.g., name).
- 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...