43

面试官问:能否模拟实现JS的new操作符

 5 years ago
source link: https://juejin.im/post/5bde7c926fb9a049f66b8b52
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
前言 用过Vuejs的同学都知道,需要用new操作符来实例化。 new Vue({ el: '#app', mounted(){}, }); 复制代码那么面试官可能会问是否想过new到底做了什么,怎么模拟实现呢。 附上之前写文章写过的一段话:

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK