杜晓浩
杜晓浩
全部文章
分类
归档
标签
去牛客网
登录
/
注册
杜晓浩的博客
全部文章
(共16篇)
题解 | #Proxy计数器#
let count = 0 const _proxy = object => { // 补全代码 const proxy=new Proxy(object,{ get...
2023-06-07
0
234
题解 | #回文字符串#
const _isPalindrome = string => { // 补全代码 let str=string.split('') while(str.length>1){ ...
2023-06-07
3
384
题解 | #Getter#
class Rectangle { // 补全代码 constructor(h,w){ this.height=h; this.width=w; ...
2023-06-07
0
264
题解 | #判断质数#
Number.prototype._isPrime=function(){ for(let i=2;i<this;i++){ if(this%i==0){ return fa...
2023-06-07
0
253
题解 | #数组扁平化#
const _flatten = arr => { // 补全代码 let res=[] for(const v of arr){ if(typeof v =...
2023-06-07
0
311
题解 | #柯里化#
function curryIt(fn) { let args=[] const fnn= (arg)=>{ args.push(arg) if(args.length===3){ return fn(...args) ...
2023-06-05
0
283
题解 | #柯里化#
function curryIt(fn) { let args=[] return (a)=>{ args.push(a) return (b)=>{ args.push(b) return ...
2023-06-05
0
284
题解 | #事件委托#
<!DOCTYPE html> <html> <head> <meta charset=utf-8> </head> <body> <ul> ...
2023-06-04
0
244
题解 | #使用闭包#
function makeClosures(arr, fn) { return arr.map((v)=>{ return fn.bind(fn,v) }) }
2023-06-04
0
253
题解 | #查找重复元素#
function duplicates(arr) { const num={} for(const v of arr){ if(v in num){ num[v]++ }else{ num[v]=1 ...
2023-06-04
0
245
首页
上一页
1
2
下一页
末页