码迷,mamicode.com
首页 > 编程语言 > 详细

javascript 对象 工厂方式和构造函数

时间:2015-06-11 16:40:41      阅读:113      评论:0      收藏:0      [点我收藏+]

标签:

1.一个简单的代码

function s(names){this.name=names;this.showname=functoin(){ alert(this.name);}} //工厂方式

new s("张三").showname(); // 函数中 ‘this‘ 的理解

2. 面向对象的定义、特点、 对象原型prototype

 

javascript 对象 工厂方式和构造函数

标签:

原文地址:http://www.cnblogs.com/lesbesgusyll/p/4569271.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!