![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JavaScript
SuperStonne
爱编程,爱生活
展开
-
JavaScript 创建对象的几种方式
object-created //1.factory pattern to create object, using this pattern we can not determine the type of the instance, it is just a instance of Object var person1 = null; var pe原创 2015-06-28 15:20:23 · 359 阅读 · 0 评论 -
JavaScript继承的几种方式
object-extend var instance1 = null; var instance2 = null; /* //1.extend from prototype chain, using this pattern there is a problem when there is a refrence type原创 2015-06-28 17:45:56 · 386 阅读 · 0 评论 -
JavaScript块级作用域
block-level-scope for(var i = 0; i < 10; i++){ } alert(i); (function(){ for(var j = 0; i < 10; i++){ } })(); //alert(j);//ReferenceError: j is原创 2015-06-28 20:59:05 · 399 阅读 · 0 评论