Well the short answer is no, you can also add properties to the object’s prototype. If there are some properties which need to be present on each instance of the object, then it makes perfect sense to add it to the prototype.
This returns an empty object because you haven’t added any properties to the duck object itself.
And this is working because, you added a name property to the Animal.prototype object and since duck inherits all of the properties from that object , you can use it.
In simper terms, when this line runs, the compiler will first check if the duck object contains the property name and since it does not, the next place it will check is the duck object’s prototype.
This whole procedure is called the prototype chain and if you want to learn more about it, here’s a resource.