![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JS面向对象
文章平均质量分 80
muyuqinchen
这个作者很懒,什么都没留下…
展开
-
JS面向对象 简单了解
对照Java类分析 每一个Function就是一个对象(类) //构造方法 function HelloWorld(){ alert("Hello world!"); } 使用JS中的prototype原型关键字进行赋值,比如为一个对象添加name属性和方法,如下: //添加 成员变量 和 成员方法 HelloWorld.prototype={ name:'...原创 2014-04-28 19:12:00 · 85 阅读 · 0 评论 -
JS面向对象
1、JS构造类实例: function Person(name,age,address){ this.name=name; this.age=age; this.address=address; this.showInfo=function(){ alert("name: "+this.name+" age: "+this.age+"...原创 2014-04-29 00:49:59 · 70 阅读 · 0 评论