js里的prototype使用示例
实现代码如下: function people(name){ this.name=name; this.introduce=function(){ //对象方法 alert("my name is"+this.name); } } people.run=function(){ //类方法 aler
实现代码如下: function people(name){ this.name=name; this.introduce=function(){ //对象方法 alert("my name is"+this.name); } } people.run=function(){ //类方法 aler
首先我们继续上文的代码,我们来把这段代码延伸一下: 实现代码如下: var Person = function (name, age) { this.name = name; this.age = age; this.Introduce = function () { alert("My name