Is there any problem in writing js inheritance compared to js parasitic combinatorial inheritance?

    function Sup(){
        this.name = "adc";
        this.arr = [1,2,3];
    }

    Sup.prototype.say = function(){
        console.log(this.arr)
    }

    function Sub(){
        Sup.call(this)
    }

    Sub.prototype = Sup.prototype

    var c1 = new Sub()
    var c2 = new Sub()
Feb.28,2021

reference question
directly assign Sub.prototype and Sup.prototype to the same memory address
all will interact with each other Sup the prototype method defined in Sub , there will also be
generally: Sub.prototype = Object.create (Sup.prototype)


upstairs the positive solution
problem is very big, and you want to give Sub. It is equivalent to adding a method to the child but modifying the parent's prototype. If you have another Sub1 , then Sub1 will also have the methods you add, which is certainly not what we expected.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b5a1-2c293.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b5a1-2c293.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?