在测试bind()函数时,习惯性的写了一个person对象,并添加了name属性。 在之后输出this.name时,本应是undefined,结果却是空。 const person = { name:"张三", getName: function(){ return this.name } } // 获取person对象中的getName方法 const unboundGetName =
专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]
Copyright (C)ICode9.com, All Rights Reserved.
ICode9版权所有