javascript 类的继承和实例化

<script>
function JSClass()
 {
    this.Attribute1 = null;
    this.Attribute2 = null;

    this.Method1 = function()
    {
       alert("ffff");
    };

    this.Method2 = function()
    {
      
    };

    this.toString = function()
    {
       return '[class JSClass]';
    };
 }
var jsclass = new JSClass();
alert(jsclass);
 jsclass.Method1();
 </script> 

 
原文地址:https://www.cnblogs.com/ZetaChow/p/2237411.html