上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 499 下一页
摘要: import {computed} from "vue" export function useComputed(fn) { const map = new Map() return function(...args) { const key = JSON.stringify(args); if ( 阅读全文
posted @ 2024-10-22 15:01 Zhentiw 阅读(59) 评论(0) 推荐(0)
摘要: // loop function demo1() { // before loop beforeLoopCode; for (initCode; conditionCode; stepChangeCode) { loopCode } postCode } // recursive function 阅读全文
posted @ 2024-10-22 14:51 Zhentiw 阅读(30) 评论(0) 推荐(0)
摘要: class MemoizeMap { constructor() { this._map = new Map(); this._weakMap = new WeakMap(); } _isObject(v) { return typeof v "object" && v !== null; } se 阅读全文
posted @ 2024-10-21 14:33 Zhentiw 阅读(29) 评论(0) 推荐(0)
摘要: Promise.myAll = function (promises) { let res, rej; const p = new Promise((resolve, reject) => { res = resolve; rej = reject; }); let i = 0; let resul 阅读全文
posted @ 2024-10-18 14:54 Zhentiw 阅读(29) 评论(0) 推荐(0)
摘要: Function.apply.myCall = function (ctx, ...args) { ctx = ctx null || ctx undefined ? globalThis : Object(ctx); const fn = this; const key = Sybmol("fn" 阅读全文
posted @ 2024-10-18 14:40 Zhentiw 阅读(36) 评论(0) 推荐(0)
摘要: For Javascript Object, you cannot assume the order of Object property the same as the order of adding those property. The actual order follow this rul 阅读全文
posted @ 2024-10-14 15:01 Zhentiw 阅读(29) 评论(0) 推荐(0)
摘要: Proxy The Proxy object enables you to create a proxy for another object, which can intercept and redefine fundamental operations for that object. So w 阅读全文
posted @ 2024-10-10 15:16 Zhentiw 阅读(50) 评论(0) 推荐(0)
摘要: [] + [] Answer: "" Both arrays ([]) are first converted to their string representations before the + operator is applied. In JavaScript, arrays are co 阅读全文
posted @ 2024-10-10 14:47 Zhentiw 阅读(38) 评论(0) 推荐(0)
摘要: const obj = { a: 1, b: 2, c: { d: 1, e: 2, }, }; function isObject(val) { return val !== null && typeof val "object"; } function observe(obj) { const 阅读全文
posted @ 2024-10-09 15:07 Zhentiw 阅读(30) 评论(0) 推荐(0)
摘要: const obj = { a: 1, b: 2, c: { a: 1, b: 2, }, }; function isObject(val) { return val !== null && typeof val "object"; } function observe(obj) { for (l 阅读全文
posted @ 2024-10-09 14:58 Zhentiw 阅读(24) 评论(0) 推荐(0)
上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 499 下一页