2013年5月9日

[[Prototype]] and Prototype

摘要: 经常会谈论到prototype,实例对象的prototype对象和function的prototype属性是两个不同的概念,但是经常被初学者混淆。这儿用实例对象表示通过对应function创建的object,是相对于对应的constructor而言的。在ES中没有实例对象这个说法。实例对象的prototype对象,一般称之为原型对象,内部属性[[Prototype]](一般用[[]]表示内部属性)指向此对象,不过通常[[Prototype]]不能直接被访问,部分浏览器提供非标准的__proto__,可以它可以访问原型对象function的prototype属性可以直接访问。使用function 阅读全文

posted @ 2013-05-09 16:34 残月下章台 阅读(215) 评论(0) 推荐(0) 编辑

Javascript中this的取值

摘要: this是javascript中非常基础的一个知识点,也是一个令很多初学者迷惑的知识点。Ecmascript中对其描述如下:There is a this value associated with every active execution context. The this value depends on the caller and the type of code being executed and is determined when control enters the execution context. The this value associated with an 阅读全文

posted @ 2013-05-09 16:27 残月下章台 阅读(298) 评论(0) 推荐(0) 编辑

导航