Comments (1)
问:如果一个构造函数,bind了一个对象,用这个构造函数创建出的实例会继承这个对象的属性吗?为什么?
不会继承,因为根据 this 绑定四大规则,new 绑定的优先级高于 bind 显示绑定,通过 new 进行构造函数调用时,会创建一个新对象,这个新对象会代替 bind 的对象绑定,作为此函数的 this,并且在此函数没有返回对象的情况下,返回这个新建的对象
from fe-interview.
Related Issues (20)
- 10. js中的基本类型和引用类型
- 11. webpack的作用及核心配置 HOT 10
- 12.闭包,new,箭头函数 HOT 1
- 13.获取对象属性的几种方法
- 14.解释下Promise与Promise.all HOT 1
- 15.JS中的面向对象,class,prototype和__proto__ HOT 1
- 16. mvc与mvvm的区别
- 17.前端性能优化的常用手段
- 18. http网络请求基本知识 HOT 2
- 19. Vue常见面试题 HOT 1
- 20.跨域及解决方案 HOT 2
- 21. Symbol的应用场景?
- 22.散装知识点 HOT 7
- 23.前端排序算法汇总 HOT 1
- 24. js实现二叉树的前序、中序、后续、层序遍历
- 25.前端常见算法 HOT 2
- 26. Set,Map,Symbol
- 27.html5语义化标签 HOT 1
- 28.常见css基础面试题
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 fe-interview.