Search⌘ K

Exercise 1: Who's the Teacher?

Explore how to define properties on JavaScript objects and establish prototype inheritance between them. This exercise helps you understand prototypal inheritance by setting Person as the prototype of Teacher, enabling property sharing and reinforcing core OOP concepts in JavaScript.

We'll cover the following...

Problem Statement

In this exercise, two object literals, Person and Teacher are given.

Define the following properties in the Person object:

  • name and set is as Amy.

  • age ...