introduce 相关的软件列表

首页

js里的prototype使用示例

2020-02-16 标签:js,里的,prototype,使用,示例,实现,代码,如下,script,type,text,javascript,function,people,n,ame,introduce,对象,方法,alert

实现代码如下: function people(name){ this.name=name; this.introduce=function(){ //对象方法 alert("my name is"+this.name); } } people.run=function(){ //类方法 aler

JavaScript学习日志6 prototype的提出
JavaScript

JavaScript学习日志6 prototype的提出

2020-02-16 标签:javascript,学习,笔记,prototype,提出,首先,继续,上文,代码,把这,延伸,实现,如下,script,type,text,var,person

首先我们继续上文的代码,我们来把这段代码延伸一下: 实现代码如下: var Person = function (name, age) { this.name = name; this.age = age; this.Introduce = function () { alert("My name