Why should the prototypical inheritance method be used to inherit the prototype of the parent class in the parasitic assembly inheritance in JS?

  javascript, question

I have just started to learn js, and saw the section of Parasitic Combination Inheritance in js Elevation, but I don’t quite understand the code given in the book.
What I understand is: Parasitic combinatorial inheritance is to avoid the problem of duplicate attributes in instance attributes and prototype objects in combinatorial inheritance. It inherits attributes in parent class constructors by borrowing constructors, and inherits prototype objects of parent classes by using prototype inheritance.
This is the code in the book:

function inheritPrototype(SubType,SuperType){
 var pro = Object.create(SuperType.prototype);
 pro .constructor = SubType;
 SubType.prototype = pro ;
 bracket

However, what is the difference between it and the following functions?

function inheritPrototype(SubType,SuperType){
 SubType.prototype = SuperType.prototype;
 SubType.prototype.constructor = SubType;
 bracket

I don’t quite understand why the prototype inheritance method is used to inherit the prototype of the parent class. Isn’t prototype inheritance a shallow copy? What is the difference between this and direct assignment?

The code above, if you are inSubTypeFor example:

SubType.prototype.fn = function(){...}

This will not affectSuperType.prototype.

The following code will.