上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 20 下一页
摘要: <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)
摘要: 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)
摘要: 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)
摘要: 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)
摘要: 吾日三省吾身,见不贤而内自省也 原型: 所有函数都有一个prototype属性,这个对象就是原型。 所有引用类型的__proto__属性都指向它的构造函数的prototype。 原型链: 当访问对象的某个属性时,先查找对象本身是否存在该属性,如果没有找到就去它的隐式原型__proto__(即构造函数 阅读全文
posted @ 2021-05-20 21:17 国服第一李师师 阅读(51) 评论(0) 推荐(0)
摘要: 今天突然看到一个字符串排列的算法,考虑自己写一下实在是太难了; 例子: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)
摘要: 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)
摘要: <!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)
摘要: 社区看了很多,无法用饼图来实现,在官方 Issues 看到类似问题,官方已解决,使用极坐标来实现。 option = { title: { text: '95.08%', textStyle: { color: '#333', fontSize: 16 }, subtext: '100万', sub 阅读全文
posted @ 2021-04-22 17:47 国服第一李师师 阅读(3250) 评论(0) 推荐(0)
摘要: 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 下一页