当前位置:网站首页>What did the new operator do? Interview
What did the new operator do? Interview
2022-07-18 22:16:00 【Big chicken legs are best】
Function. prototype. a=() => alert( 1)
Object. prototype. b=() => console.log( 2)
function A(){}
const a= new A()
console. log( A.prototype)
a. a()
a. b()
The output is as follows

In fact, you typeof a by object
new Operators will experience the following 4 A step
- Create a new object ;
- Assign the scope of the constructor to the new object ( therefore this It points to this new object );
- Execute code in constructor ( Add properties for this new object );
- Return to new object ;
therefore a Is an instance object , His __proto__ Pointing to object.prototype, So you can only access the arrow function b
But can you access it b()
边栏推荐
- TimeSformer: 只靠 Transformer 就能理解视频?注意力机制的又一次进击!
- 华为 od js 拼接URL
- 【C语言对数据文件的顺序读写】
- Accéder aux variables locales dans une classe interne anonyme
- 毕业季--数据库常见面试题
- Stream - elegant handling of collection elements
- 信息收集
- How many QPS are your interfaces?
- Neutral energy optimization of transport layer triple handshake
- Ucos-iii learning notes - Software Timer
猜你喜欢

传输层 三次握手中性能优化

Caractéristiques et mode d'utilisation de la batterie ni MH (mécanisme de charge de la batterie ni MH FDK)

Leetcode 1342. 将数字变成 0 的操作次数

Characteristics and usage of Ni MH battery (FDK Ni MH battery charging mechanism)

Leetcode 1332. Delete the palindrome subsequence (after reading the problem solution, you suddenly realize

迪奥疑似抄袭中国马面裙,国内官网已下架该产品

Domestic light! High score spatiotemporal representation learning model uniformer

Application of Apache E7 series industrial computer minipicecan card in meal delivery robot

In depth analysis of multiple knapsack problem (Part 2)

Practical application of machine learning: quickly brush five machine learning problems of Niuke
随机推荐
Switching mode converter resource scheme of mp1655gg-z mps/ American core MOSFET
Istio灰度发布:部署Bookinfo微服务项目
Stream - elegant handling of collection elements
图像、视频、3D 数据一把抓,不挑食的 AI 模型 Omnivore !
Sword finger offer 10- ii Frog jumping on steps (4 solutions)
Which brand of Bluetooth headset is good at noise reduction? 2022 noise reduction headset ranking
降噪蓝牙耳机哪款好?性价比最高的主动降噪蓝牙耳机
[UCOS III source code analysis] - event flag group
Leetcode 1332. 删除回文子序列(看完题解才恍然大悟!!!!!!!)
Omnivore, a non picky AI model, focuses on images, videos and 3D data!
surging作者出具压测结果
Leetcode 1342. Number of operations to change the number to 0
Comparison and reference of collaborative office system (OA system) selection in 2022
C language - array
射击比赛的成绩 华为od js
Which kind of noise reduction Bluetooth headset is good? The most cost-effective active noise reduction Bluetooth headset
Publication en niveaux de gris istio: déploiement du projet de microservice bookinfo
机器学习实战运用:速刷牛客5道机器学习题目
[UCOS III source code analysis] - task creation
information gathering