参考:http://stackoverflow.com/questions/650764/how-does-proto-differ-from-constructor-prototype http://blog.rainy.im/ __proto__ is the actual object that is used in the lookup chain to resolve methods, etc. prototype is the object that is used to build…
今天重温了下Javacript,给大家带来一篇Javascript博文,相信对于Javacript有一定了解的人都听过prototype原型这个概念,今天我们深度的分析下prototype与__proto__. 好了,下面看一个非常简单的例子: var Person = function(name) { this.name = name ; }; var p = new Person("Ben"); console.log(p.name); 代码简单的 你不用说明了,如果现在让大家根据…
一.2个参考网址: http://icekiller110.iteye.com/blog/1566768 http://www.cnblogs.com/snandy/archive/2012/09/01/2664134.html 我是看第一个明白的最多的,因为归纳的比较到位,第二个网址写的内容比较详实 二.概念 __proto__是JS内部使用寻找原型链的属性. prototype是显示修改对象的原型的属性. 三.一个例子 <script> var Person = function () {…
js in depth: arrow function & prototype & this & constructor https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions https://hacks.mozilla.org/2015/06/es6-in-depth-arrow-functions/ https://stackoverflow.com/…