Comments (18)
你好,我有个疑问。您的文章是this instanceof that,而规范是this instanceof FNOP,这两种判断有区别吗?因为that指向原始函数,FNOP指向中间函数
from blog.
@xumeiyan 我认为你说的就是可能就是下面的意思
var A = function() {}
var B = function() {}
var C = function() {}
B.prototype = A.prototype
C.prototype = new B()
var D = new C()
console.log(D instanceof C) //true
console.log(D instanceof B) //true
看下这个定义
instanceof 运算符用来测试一个对象在其原型链中是否存在一个构造函数的 prototype 属性。
所以上面两者不同的情况我认为应该是一样的,因为是继承的关系都在一条原型链上,只要对象在其上面能找到prototype属性就够了
from blog.
了解了。非常感谢。下面还有个fNOP.prototype = this.prototype;
from blog.
👍 可以用 https://github.com/Raynos/function-bind 这个库的源码作为讲解,估计会更清晰
from blog.
@xumeiyan 这句就是FNOP这个空函数的prototype属性的指向,指向bar的prototype,这样后面new出来的就在这个空函数的原型链上了。instanceof也就是true了
from blog.
@tobeyouth 哈哈好的,待会研究一下 不过我一直没太明白bind返回的函数没有prototype,那new出来的实例不就没有原型链了么
from blog.
额。。。我只想说,我被作者的头像惊呆了。。。
from blog.
@HOUCe 妹子太惊艳么233, 看了您的文章觉得好棒,还看了下面的评论决定自己再梳理一遍哈哈哈
from blog.
需要BAT内推 欢迎联系我啊。微信:13051310872
from blog.
@HOUCe 好的谢谢您
from blog.
@HOUCe 诚恳的希望你招了这个妹纸~
from blog.
@mqyqingfeng 这..这是我女票[捂脸]
from blog.
@Aaaaaaaty 没有问题呐,接着让 @HOUCe 招你女票,教成前端~ 😂
from blog.
@mqyqingfeng 就是不招我哈哈哈哈哈😂
from blog.
@Aaaaaaaty 哈哈,这个就要看 @HOUCe 啦~
from blog.
没关系 慢慢向 @mqyqingfeng @HOUCe 老师们学习~
from blog.
哎呀,老师这个称呼可不敢当,不过我祝愿你们俩都能被 @HOUCe 老师招走 😀
from blog.
@mqyqingfeng 哈哈哈好的谢谢您
from blog.
Related Issues (20)
- 用canvas实现视频播放与弹幕功能 HOT 5
- 基于canvas使用贝塞尔曲线平滑拟合折线段 HOT 8
- 基于canvas使用粒子拼出你想要的文字 HOT 7
- 11
- 基于canvas使用粒子拼出你想要的文字[2]——粒子的动画效果
- bezierMaker.js——N阶贝塞尔曲线生成器 HOT 6
- Canvas进阶——贝塞尔公式推导与物体跟随复杂曲线的轨迹运动 HOT 1
- canvas进阶——实现静态图像的变形并合成动态效果 HOT 6
- 基于JavaScript求解八数码的路径搜索并生成动画效果 HOT 4
- 记一次“失利后”经过半年准备通过阿里社招的经历与感悟 HOT 25
- aaa HOT 1
- 由一个“bug”到鲜为人知的jQuery.cssHooks
- 结合kmp算法的匹配动画浅析其基本** HOT 3
- 有掘金地址吗 HOT 1
- 你好 我想请问下 我根据您写的绘制贝塞尔曲线,拿到的[x,y]的数据 如何让物体跟随运动
- 淘系技术部-用户增长团队内推指南
- 阿里面试评级 HOT 2
- 怎么更好的阅读博客?
- 请问一下基于JS的深度优先搜索生成动画怎么解啊
- 回顾从学生到阿里,经历的几次蜕变 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blog.