上一页 1 2 3 4 5 6 7 8 9 10 ··· 42 下一页
摘要: names=['张三','李四','阿猫','王五','岳云鹏'] names.sort((a,b)=>a.localeCompare(b)) 阅读全文
posted @ 2024-07-29 16:34 howhy 阅读(32) 评论(0) 推荐(0)
摘要: class Person { constructor(name, age) { this.name = name this.age = age } } function creataOnlyOneCls(target) { let cls; return new Proxy(target, { co 阅读全文
posted @ 2024-07-26 16:21 howhy 阅读(37) 评论(0) 推荐(0)
摘要: 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 阅读(34) 评论(0) 推荐(0)
摘要: 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 阅读(54) 评论(0) 推荐(0)
摘要: 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 阅读(38) 评论(0) 推荐(0)
摘要: 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 阅读(23) 评论(0) 推荐(0)
摘要: 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 阅读(168) 评论(0) 推荐(0)
摘要: const pending = 'pending' const fulfilled = 'fulfilled' const rejected = 'rejected' class MyPromise { #state = pending #result = undefined #handler = 阅读全文
posted @ 2024-05-22 17:47 howhy 阅读(26) 评论(0) 推荐(0)
摘要: 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 阅读(31) 评论(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 阅读(23) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 10 ··· 42 下一页