上一页 1 2 3 4 5 6 7 8 ··· 42 下一页
摘要: 1、首先根据用户自定义样式和浏览器默认样式声明:确定有值有样式(不解决冲突) 2、计算样式重叠(冲突):确定冲突的样式 3、继承样式:对没有确定可以继承的样式从父元素继承 4、若样式还没有确认则使用浏览器默认 阅读全文
posted @ 2025-12-20 10:29 howhy 阅读(56) 评论(0) 推荐(0)
摘要: function formatDate(date, format='date') { if(typeof format 'function'){ format=format(); } if(typeof format !=='string'){ return new TypeError('forma 阅读全文
posted @ 2025-12-05 16:43 howhy 阅读(23) 评论(0) 推荐(0)
摘要: function Foo(a,b){ console.log(a==arguments[0],b==arguments[1]); console.log(a,b); a='44'; b='555'; console.log(a==arguments[0],b==arguments[1]); //若F 阅读全文
posted @ 2025-12-03 14:47 howhy 阅读(20) 评论(0) 推荐(0)
摘要: 1、原始转数字: Boolean转数字:true :1 false: 0 null: 0 undefined: NaN []: 0 {}:NaN ' \r\t\n ': 0 ' 123\t ' :123 'anc':NaN 2、所有转Boolean: 这几种情况是false:0 null undef 阅读全文
posted @ 2025-12-03 14:00 howhy 阅读(21) 评论(0) 推荐(0)
摘要: function myNew(constructor, ...args) { // 参数验证 if (typeof constructor !== 'function') { throw new TypeError('myNew: First argument must be a function' 阅读全文
posted @ 2025-11-26 15:53 howhy 阅读(17) 评论(0) 推荐(0)
摘要: class MyPromise{ constructor(executor){ this.state='pending'; this.value=undefined; this.reason=undefined; this.onFulfilledCallbacks=[]; this.onReject 阅读全文
posted @ 2025-11-26 11:45 howhy 阅读(11) 评论(0) 推荐(0)
摘要: 1. Promise.all() 概念 等待所有 Promise 成功,或者任何一个 Promise 失败。 2. Promise.race() 概念 返回第一个 settled(完成或拒绝)的 Promise。 3. Promise.any() 概念 返回第一个成功的 Promise,如果所有 P 阅读全文
posted @ 2025-11-26 10:34 howhy 阅读(14) 评论(0) 推荐(0)
摘要: let _curDependFun=null; class dependCls{ constructor(){ this.dependFuns=new Set(); } depend(){ _curDependFun && this.dependFuns.add(_curDependFun); } 阅读全文
posted @ 2025-11-26 09:34 howhy 阅读(33) 评论(0) 推荐(0)
摘要: + 运算符的双重角色 JavaScript 中的 + 运算符有两个主要功能: 数字加法 字符串拼接 类型转换规则 1. 基本规则 当使用 + 运算符时,JavaScript 遵循以下优先级: 如果任一操作数是字符串,进行字符串拼接 否则,尝试将两个操作数转换为数字进行加法运算 对象到原始值的转换过程 阅读全文
posted @ 2025-11-26 09:24 howhy 阅读(23) 评论(0) 推荐(0)
摘要: function curry(func) { return function curried(...args) { const context = this; // 如果参数数量足够,直接执行原函数 if (args.length >= func.length) { return func.appl 阅读全文
posted @ 2025-11-25 11:49 howhy 阅读(15) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 42 下一页