会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Howhy Blogs
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
···
38
下一页
2024年7月26日
js 方法重载实现
摘要: function createFunOverLoad() { const funMap = new Map() console.log(funMap) const funOverLoad = function (...args) { const key = args.map(param => typ
阅读全文
posted @ 2024-07-26 15:47 howhy
阅读(15)
评论(0)
推荐(0)
2024年7月18日
js 动态添加日志
摘要: const calculator = { count: 0, next() { return ++this.count }, double(a) { return a * 2 }, add(a, b) { return a + b } } calculator.add(2, 3) // functi
阅读全文
posted @ 2024-07-18 18:21 howhy
阅读(22)
评论(0)
推荐(0)
js用户自定义配置替换默认配置方法
摘要: const customConfig = { a: 22, b: 33 } function config(config = {}) { const defaultConfig = { a: 12, b: 23, c: 'aa' } const finallyConfig = { ...defaul
阅读全文
posted @ 2024-07-18 18:02 howhy
阅读(25)
评论(0)
推荐(0)
数组groupby
摘要: const students = [ { name: 's1', age: 22, sex: 'female' }, { name: 's2', age: 22, sex: 'male' }, { name: 's3', age: 23, sex: 'female' }, { name: 's4',
阅读全文
posted @ 2024-07-18 16:35 howhy
阅读(10)
评论(0)
推荐(0)
2024年6月3日
xigua haokan
摘要: const requestpromise = require("request-promise"); const crypto = require('crypto'); function md5(str) { const hash = crypto.createHash('md5'); hash.u
阅读全文
posted @ 2024-06-03 14:21 howhy
阅读(123)
评论(0)
推荐(0)
2024年5月22日
手写promise
摘要: const pending = 'pending' const fulfilled = 'fulfilled' const rejected = 'rejected' class MyPromise { #state = pending #result = undefined #handler =
阅读全文
posted @ 2024-05-22 17:47 howhy
阅读(10)
评论(0)
推荐(0)
2024年5月16日
url并发请求
摘要: function batchRequest(urls,maxNum){ return new Promise(resolve=>{ if(urls.length 0){ resolve([]); return; } const results=[]; let index=0; let finishC
阅读全文
posted @ 2024-05-16 17:50 howhy
阅读(10)
评论(0)
推荐(0)
并行排除任务代码
摘要: class SuperTask { constructor(parallelCount = 2) { this.parallelCount = parallelCount; this.tasks = []; this.runningCount = 0; } add(task) { return ne
阅读全文
posted @ 2024-05-16 17:34 howhy
阅读(15)
评论(0)
推荐(0)
2024年5月15日
js箭头函数特点
摘要: js箭头函数特点: 1、不可以new 2、 没有原型prototype 3、没有arguments 4、 没有this
阅读全文
posted @ 2024-05-15 17:01 howhy
阅读(10)
评论(0)
推荐(0)
js防抖和限流函数
摘要: function debounce(fn, delay) { let timer; let tht = this; return function (...args) { clearTimeout(timer) console.log(...args) timer = setTimeout(() =
阅读全文
posted @ 2024-05-15 13:54 howhy
阅读(74)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
···
38
下一页
公告