function Class1(arg1,arg2)
    {
        this.name = arg1;
        this.pass = arg2;
        this.showSub = function()
        {
            return this.name - this.pass;
        }
    }
    
    function Class2(arg1,arg2,arg3)
    {
        Class1.call(this,arg1,arg2);
        this.get3Arg = function()
        {
            return arg3;
        }
    }
    var class1 = new Class1(5,6);
    console.log(class1.showSub());
    var class2 = new Class2(10,1,12);
    console.log(class2.showSub());
    console.log(class2.get3Arg());

 

相关文章:

  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
  • 2021-08-01
  • 2021-05-19
  • 2022-02-10
  • 2021-06-27
  • 2022-02-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-24
  • 2022-12-23
  • 2022-12-23
  • 2021-10-05
  • 2021-08-01
相关资源
相似解决方案