fe-interview-handwrite
fe-interview-handwrite copied to clipboard
📖 前端面试常见手写题整理
仓库里的实现输出是 number 不是 number[],然后 arr 的状态转移也不太对。不知道是题不一样还是写成了别的。 自己实现了一下 ```ts function lis(nums: number[]): number[]{ if (nums.length === 0) return []; const arr = new Array(nums.length).fill(1); // 保存以当前位置结尾的最大连续子串长度 for (let i = 1;...
在没有resolve的时候直接调.then的话, 会进入reject
外网改编了一个Promise A+代码,可通过A+测试,面试必备
Function.prototype.myCall = function (context, ...paramsArr) { if (context === null || context === undefined) { context = window; } else { context = Object(context); // *** } const specialPrototype =...
可以在代码中添加注释,比如题目背景,原理,一些过程中的注释