上一页 1 ··· 69 70 71 72 73 74 75 76 77 ··· 491 下一页
摘要: export const inferItemLiteral = <T>(t: T) => { return { output: t, }; }; const result1 = inferItemLiteral("a"); // ? {output: string} /* vs */ export 阅读全文
posted @ 2023-04-10 21:31 Zhentiw 阅读(17) 评论(0) 推荐(0)
摘要: There are two options doing the same things. const makeSafe = <TParams extends any[], TReturn>(func: (...args: TParams) => TReturn) => ( ...args: TPar 阅读全文
posted @ 2023-04-10 21:16 Zhentiw 阅读(21) 评论(0) 推荐(0)
摘要: Compare two code snippet const people = [ {id: 1,name: 'John', age: 45}, {id: 2,name: "Op", age: 32}, {id: 3, name: "Wade",age: 39 } ] // option 1 con 阅读全文
posted @ 2023-04-07 19:58 Zhentiw 阅读(26) 评论(0) 推荐(0)
摘要: Write a function that takes in an array of positive integers and returns the maximum sum of non-adjacent elements in the array. If the input array is 阅读全文
posted @ 2023-04-05 02:43 Zhentiw 阅读(139) 评论(0) 推荐(0)
摘要: The transpose of a matrix is an operator which flips a matrix over its diagonal; that is, it switches the row and column indices of the matrix A by pr 阅读全文
posted @ 2023-04-04 01:49 Zhentiw 阅读(29) 评论(0) 推荐(0)
摘要: Write a function that takes in two strings and returns their longest common subsequence. A subsequence of a string is a set of characters that aren't 阅读全文
posted @ 2023-03-30 01:35 Zhentiw 阅读(46) 评论(0) 推荐(0)
摘要: ProductCard component import './ProductCard.css'; import { ReactNode } from 'react'; import * as React from 'react'; import ProductCardContext from '. 阅读全文
posted @ 2023-03-30 00:58 Zhentiw 阅读(22) 评论(0) 推荐(0)
摘要: .card { width: min(700px, 90%, 70vw); // take the one currently is the min height: max(300px, 90%, 40vh); // take the one currently is the max font-si 阅读全文
posted @ 2023-03-30 00:42 Zhentiw 阅读(16) 评论(0) 推荐(0)
摘要: Refer to https://dev.to/frehner/css-vh-dvh-lvh-svh-and-vw-units-27k4 he lvh, svh, and dvh units in CSS are used to specify heights relative to the vie 阅读全文
posted @ 2023-03-30 00:37 Zhentiw 阅读(47) 评论(0) 推荐(0)
摘要: const demoFunc = <TObj extends {}>(obj: TObj, key: ErrorIfNever<keyof TObj, `You much pass at least one key`>) => { return obj[key as keyof TObj] } ty 阅读全文
posted @ 2023-03-30 00:29 Zhentiw 阅读(22) 评论(0) 推荐(0)
上一页 1 ··· 69 70 71 72 73 74 75 76 77 ··· 491 下一页