摘要: 图解https 阅读全文
posted @ 2022-10-26 21:12 pocoui 阅读(20) 评论(0) 推荐(0)
摘要: 注意区分 节流(射击游戏)n秒内只执行一次 例:子弹发射小游戏,无论点击频率是多少,在一定的时间内只会发射1个子弹。 防抖(广告) n秒后执行 例:相当于看视频需要先看广告,如果刷新页面,那么就要重头开始看广告。 阅读全文
posted @ 2022-10-26 11:32 pocoui 阅读(19) 评论(0) 推荐(0)
摘要: class EventEmitter { // 补全代码 constructor(){ this.events = {} } on(eventName, callback){ //一个事件上注册多个回调函数 const callbacks = this.events[eventName] || [] 阅读全文
posted @ 2022-10-26 11:09 pocoui 阅读(22) 评论(0) 推荐(0)