欢迎光临散文网 会员登陆 & 注册

左程云_算法与数据结构进阶班

2022-10-22 22:30 作者:血霁玫瑰与樱花  | 我要投稿

function Person(name) {  this.name = name;}const ming = new Person("ming");const ming = (function (name) {  // 1. var temp = {}; => 创建临时对象  // 2. this = temp; => 指定 this = 临时对象  this.name = name;  // 3. Person.prototype = {...Person.prototype, constructor: Person} => 执行构造函数  // 4. this.__proto__ == Person.prototype => 绑定原型  // return this; => 返回临时对象})("ming");

左程云_算法与数据结构进阶班的评论 (共 条)

分享到微博请遵守国家法律