Haisawa's Blog 
  • 首页
  • 主站
  • 归档
  • 分类
  • 标签
  • 关于
  • 友链
  •   
  •   

「每日LeetCode」2020年9月22日

剑指 Offer 48. 最长不含重复字符的子字符串

2020-09-22
算法
LeetCode 算法 滑动窗口 哈希表

原生手动实现轮播图

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210

2020-09-22

对象扁平化

1234567891011121314151617181920212223242526272829function flatObj(obj) { const res = {}; const flat = (obj, preKey) => { if (obj === null || obj === undefined) return; O

2020-09-22

JS中的常见继承方法

本文部分转自:https://juejin.im/post/6844903798624747528 实现1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787

2020-09-22

手动实现instanceof

1234567891011121314151617181920function myInstanceOf(obj, fn) { let proto = Reflect.getPrototypeOf(obj); while (proto) { if (proto === fn.prototype) return true; proto = Reflect.getP

2020-09-22

手动实现bind

12345678910111213141516171819202122232425262728293031323334353637Function.prototype.myBind = function (context, ...args) { const fn = this; const bound = function (...args2) { const new

2020-09-22

XSS和CSRF

本文转自:https://juejin.im/post/6844903856443392014 XSS (Cross Site Script) 跨站脚本攻击XSS跨站脚本攻击是指攻击者在网站上注入恶意的客户端代码,通过恶意脚本对客户端网页进行篡改,从而在用户浏览网页时,对用户浏览器进行控制或者获取用户隐私数据的一种攻击方式。攻击者对客户端网页注入的恶意脚本一般包括 JavaScript,有时也会包

2020-09-22

手动实现一个apply

关键步骤,在 context 上调用方法,触发 this 绑定为 context和 call 基本类似,但是需要判断是否包含参数 args 123456789101112131415161718Function.prototype.myCall = function (context, ...args) { // 关键步骤,在 context 上调用方法,触发 this 绑定为 con

2020-09-21

手动实现一个call

关键是在 context 上调用方法,触发 this 绑定为 context 12345678910111213141516Function.prototype.myCall = function (context, ...args) { // 关键步骤,在 context 上调用方法,触发 this 绑定为 context,使用 Symbol 防止原有属性的覆盖 const key

2020-09-21

「每日LeetCode」2020年9月21日

二叉树的层次遍历、合并有序链表、链表中环的入口节点

2020-09-21
算法
LeetCode 算法 二叉树 队列 链表 快慢指针
1…8182838485…88

搜索

主站 Github
总访问量 次 总访客数 人
闽ICP备19017969号-2