会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
国服第一李师师
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
3
4
5
6
7
8
9
10
11
···
20
下一页
2021年6月30日
柯理化与反柯理化
摘要: <script> function sum(a,b,c,d,e){ return a+b+c+d+e } const currying = (fn,arg = [])=>(...args)=>( fn.length args.concat(arg).length?fn(...args.concat(
阅读全文
posted @ 2021-06-30 10:05 国服第一李师师
阅读(49)
评论(0)
推荐(0)
2021年6月27日
setTimeout模拟setInterval
摘要: let timer = null function interval(func,wait){ let interv = function(){ func.call(null) timer = setTimeout(interv,wait) } timer = setTimeout(interv,wa
阅读全文
posted @ 2021-06-27 21:36 国服第一李师师
阅读(54)
评论(0)
推荐(0)
2021年6月2日
promise 实现
摘要: 1实现异步调用 const PENDDING = 'pendding', RESOLVED = 'resolved', REJECTED = 'rejected' class myPromise { constructor(handler){ this.status = PENDDING this.
阅读全文
posted @ 2021-06-02 00:27 国服第一李师师
阅读(61)
评论(0)
推荐(0)
2021年5月27日
数字分隔符,三位一个逗号
摘要: let num = 12345678.002345 let start = (num + '').split('.')[0].split('').reverse() let end = (num + '').split('.')[1] let s = '',cur = '',n = start.le
阅读全文
posted @ 2021-05-27 00:30 国服第一李师师
阅读(377)
评论(0)
推荐(0)
2021年5月20日
原型 原型链 作用域链
摘要: 吾日三省吾身,见不贤而内自省也 原型: 所有函数都有一个prototype属性,这个对象就是原型。 所有引用类型的__proto__属性都指向它的构造函数的prototype。 原型链: 当访问对象的某个属性时,先查找对象本身是否存在该属性,如果没有找到就去它的隐式原型__proto__(即构造函数
阅读全文
posted @ 2021-05-20 21:17 国服第一李师师
阅读(51)
评论(0)
推荐(0)
2021年5月12日
字符串的排列
摘要: 今天突然看到一个字符串排列的算法,考虑自己写一下实在是太难了; 例子:abc abc acb bca bac cab cba var permutation = function(s) { const result = [] if(s){ queue = s.split('') permutatio
阅读全文
posted @ 2021-05-12 22:08 国服第一李师师
阅读(44)
评论(0)
推荐(0)
2021年4月26日
函数式编程compose 与Box
摘要: const compose = (...fns) =>fns.reduce((a, b) =>(...x)=> b(a(x))); const trim1 = str => { console.log(str) let s = str.trim() return s; } const toNumbe
阅读全文
posted @ 2021-04-26 19:38 国服第一李师师
阅读(277)
评论(0)
推荐(0)
2021年4月24日
双向链表插入删除反序
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi
阅读全文
posted @ 2021-04-24 23:01 国服第一李师师
阅读(41)
评论(0)
推荐(0)
2021年4月22日
环形圆角图echarts
摘要: 社区看了很多,无法用饼图来实现,在官方 Issues 看到类似问题,官方已解决,使用极坐标来实现。 option = { title: { text: '95.08%', textStyle: { color: '#333', fontSize: 16 }, subtext: '100万', sub
阅读全文
posted @ 2021-04-22 17:47 国服第一李师师
阅读(3250)
评论(0)
推荐(0)
2021年4月19日
容易忘记的冒泡排序,选择排序,插入排序,及冒泡排序的优化
摘要: 1.普通冒泡排序 for(let i=0;i<arr.length-1;i++){ for(let j=0;j<arr.length-1-i;j++){ if(arr[j]>arr[j+1]){ let t = arr[j] arr[j] = arr[j+1] arr[j+1] = t } } }
阅读全文
posted @ 2021-04-19 15:50 国服第一李师师
阅读(102)
评论(0)
推荐(0)
上一页
1
···
3
4
5
6
7
8
9
10
11
···
20
下一页
公告