摘要:
1>. 回调函数为匿名函数时,回调函数的this会指向window,需要对回调函数bind(this)。 2>. 回调函数为箭头函数时,回调函数的this会指向他的直接上层 一般来讲使用箭头➡️ 函数就好 阅读全文
posted @ 2020-11-03 19:58
Bravo_Jack
阅读(963)
评论(0)
推荐(0)
摘要:
背景 做即时聊天, 使用到websocket, 使用websocket代替axios进行ajax请求, 要做到的是一个promise中使用websocket send方法发送消息(作为request), 服务器返回这个消息的执行信息(作为response), 难点在于client端如何做到: 发送后 阅读全文
posted @ 2020-11-03 17:55
Bravo_Jack
阅读(1797)
评论(1)
推荐(0)
摘要:
问题: 我遇到了这样的问题: let callBackFunction = function(timer){ ......... // when i want to clear the TimeInterval: clearInterval(timer); }; let timer = setInt 阅读全文
posted @ 2020-11-03 17:37
Bravo_Jack
阅读(634)
评论(0)
推荐(0)

浙公网安备 33010602011771号