首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

平时遇到的前端面试题

function () { console.log(this); } } var person = new Person("meishadevs", 24); person.printThis...(); 执行结果 2、普通函数中的this指向函数的调用者 function printThis() { console.log(this); } printThis(); 执行结果...function () { console.log(this); })(); 执行结果 4、箭头函数中的this指向函数定义时所在的对象 // 定义箭头函数,打印箭头函数中的 this let printThis...= () => { console.log(this); } let o = { print: function() { printThis() } }; // 在全局调用箭头函数...printThis(); // 在对象的方法中调用箭头函数 o.print() 执行结果 通过执行结果可知我们定义的箭头函数,不管是在哪里使用 this 指向都没有发生变化都是指向函数定义时所在的对象

43030

扫码

添加站长 进交流群

领取专属 10元无门槛券

手把手带您无忧上云

扫码加入开发者社群

热门标签

活动推荐

    运营活动

    活动名称
    广告关闭
    领券