上一页 1 ··· 78 79 80 81 82 83 84 85 86 ··· 491 下一页
摘要: Consider this implementation of returnBothOfWhatIPassIn: const returnBothOfWhatIPassIn = (params: { a: unknown; b: unknown }) => { return { first: par 阅读全文
posted @ 2023-01-11 15:25 Zhentiw 阅读(18) 评论(0) 推荐(0)
摘要: Let's we have a form to submit new password. Before we send request to server, we want to force developer to valid the password before sending the req 阅读全文
posted @ 2023-01-04 15:54 Zhentiw 阅读(25) 评论(0) 推荐(0)
摘要: // print type PrintStart = { type: "print"; subtype: "start"; attributes: { controlsId: string; tabId: number; }; } type PrintAbort = { type: "print"; 阅读全文
posted @ 2023-01-04 03:46 Zhentiw 阅读(18) 评论(0) 推荐(0)
摘要: Let's imagine you're building a type helper to extract out the value from several different 'parsers'. Here are a few different examples of what a par 阅读全文
posted @ 2023-01-02 15:38 Zhentiw 阅读(20) 评论(0) 推荐(0)
摘要: Binding to Media Events import './assets/css/style.css'; import autumnMp4 from './assets/media/autumn.mp4'; const app = document.getElementById('app') 阅读全文
posted @ 2023-01-02 01:59 Zhentiw 阅读(29) 评论(0) 推荐(0)
摘要: A company has hired N interns to each join one of N different teams. Each intern has ranked their preferences for which teams they wish to join, and e 阅读全文
posted @ 2023-01-02 01:39 Zhentiw 阅读(121) 评论(0) 推荐(0)
摘要: Array.from() is a great way to chunk up arrays because of the secondary argument being a map function. const hugeArray = Array.from({length: 76}, (_, 阅读全文
posted @ 2022-12-25 20:21 Zhentiw 阅读(97) 评论(0) 推荐(0)
摘要: The Intl.Collator object enables language-sensitive string comparison. console.log(['Z', 'a', 'z', 'ä'].sort(new Intl.Collator('de').compare)); // exp 阅读全文
posted @ 2022-12-25 20:03 Zhentiw 阅读(69) 评论(0) 推荐(0)
摘要: Since arrays are objects, we can destructure their indexes to easily grab the first and last itmes const bikes = ['bianchi', 'miele', 'miyata', 'benot 阅读全文
posted @ 2022-12-25 19:59 Zhentiw 阅读(22) 评论(0) 推荐(0)
摘要: For example, we have a type repersent currency: USD, value should be something like '$123', a string type with `$` and number. So let's say we make a 阅读全文
posted @ 2022-12-24 19:15 Zhentiw 阅读(55) 评论(0) 推荐(0)
上一页 1 ··· 78 79 80 81 82 83 84 85 86 ··· 491 下一页