上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 499 下一页
摘要: Docs: https://webkit.org/blog/6240/ecmascript-6-proper-tail-calls-in-webkit/ /* This is a recursive function without PTC */ function fatorial(n) { if 阅读全文
posted @ 2024-08-07 19:29 Zhentiw 阅读(28) 评论(0) 推荐(0)
摘要: The declare keyword in TypeScript allows you to specify types for global variables. Whenever you use it, an ambient context is created, which means th 阅读全文
posted @ 2024-08-07 19:13 Zhentiw 阅读(35) 评论(0) 推荐(0)
摘要: Typescript check a file whether it contains any export/import, if it is, then it's a module; if not then it's a script. What's the difference between  阅读全文
posted @ 2024-08-07 19:04 Zhentiw 阅读(31) 评论(0) 推荐(0)
摘要: /** * How do we annotate the errors this function throws? */ type PossibleErrors = SyntaxError | DOMException; const getUserFromLocalStorage = (id: st 阅读全文
posted @ 2024-08-07 18:58 Zhentiw 阅读(28) 评论(0) 推荐(0)
摘要: For the following code: const objOfFunctions = { string: (input: string) => input.toUpperCase(), number: (input: number) => input.toFixed(2), boolean: 阅读全文
posted @ 2024-08-07 17:53 Zhentiw 阅读(41) 评论(0) 推荐(0)
摘要: import { expect, it, vitest } from 'vitest'; const logId = (obj: { id: string }) => { console.log(obj.id); }; const logName = (obj: { name: string }) 阅读全文
posted @ 2024-08-06 19:56 Zhentiw 阅读(33) 评论(0) 推荐(0)
摘要: Make those pass: import { Equal, Expect } from "@total-typescript/helpers"; type Event = "click" | "hover" | "scroll"; type CallbackType = unknown; co 阅读全文
posted @ 2024-08-06 15:13 Zhentiw 阅读(53) 评论(0) 推荐(0)
摘要: max-content https://developer.mozilla.org/en-US/docs/Web/CSS/max-content The max-content sizing keyword represents the maximum intrinsic size of the c 阅读全文
posted @ 2024-08-02 15:23 Zhentiw 阅读(64) 评论(0) 推荐(0)
摘要: function pipe<A, B>(fn: (a: A) => B) { function run(a: A) { return fn(a) } run.pipe = <C, >(fn2: (b: B) => C) => pipe((a: A) => fn2(fn(a))) return run 阅读全文
posted @ 2024-08-02 14:51 Zhentiw 阅读(40) 评论(0) 推荐(0)
摘要: type BaseTable = { [colName: string]: string | number | boolean; } type Columns<Tables extends { [tableName: string]: BaseTable }> = { [K in keyof Tab 阅读全文
posted @ 2024-08-02 14:50 Zhentiw 阅读(37) 评论(0) 推荐(0)
上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 499 下一页