function Person(){
        this.a=function(){
            window.alert("a");
        }
        this.b=function(){
            window.alert("b");
        }
        this.c="c";
        this.d="d";
    }

    var p=new Person();
    p.a();
    //p["b"];
    window.alert(p["c"]);
    window.alert(p["d"]);

运行结果:先后输出a,c,d.

相关文章:

  • 2021-10-12
  • 2021-10-13
  • 2022-12-23
  • 2021-11-07
  • 2021-12-24
  • 2022-12-23
  • 2021-09-07
猜你喜欢
  • 2021-07-31
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-13
相关资源
相似解决方案