Promise中调用this

1>. 回调函数为匿名函数时,回调函数的this会指向window,需要对回调函数bind(this)。
2>. 回调函数为箭头函数时,回调函数的this会指向他的直接上层

一般来讲使用箭头➡️ 函数就好

posted @ 2020-11-03 19:58  Bravo_Jack  阅读(950)  评论(0编辑  收藏  举报