上一页 1 ··· 183 184 185 186 187 188 189 190 191 ··· 477 下一页
摘要: const person = { name: "wan", age: 28 } type Person = typeof person type PersonKeys = keyof person // "name" | "age" type PersonKTypes = Person[Person 阅读全文
posted @ 2020-09-30 20:20 Zhentiw 阅读(156) 评论(0) 推荐(0)
摘要: In Javascript, you know typeof: typeof [] // object typeof "" // string In Typescript it is more smart: const person = { name: "wan", age: 28 } type P 阅读全文
posted @ 2020-09-30 20:11 Zhentiw 阅读(159) 评论(0) 推荐(0)
摘要: import { compose } from "ramda"; let input = document.getElementById("input"); let inputBroadcaster = (listener) => { input.addEventListener("input", 阅读全文
posted @ 2020-09-30 18:32 Zhentiw 阅读(193) 评论(0) 推荐(0)
摘要: import { compose } from "ramda"; let input = document.getElementById("input"); let inputBroadcaster = (listener) => { input.addEventListener("input", 阅读全文
posted @ 2020-09-30 18:12 Zhentiw 阅读(154) 评论(0) 推荐(0)
摘要: See the following example: const elem = document.querySelector('.click'); function handleClick(event: Event) { event.preventDefault(); console.log(thi 阅读全文
posted @ 2020-09-30 01:17 Zhentiw 阅读(422) 评论(0) 推荐(0)
摘要: Because Javascript has inconsistent way to cleanup the lisenters: removeEventListener(button, "click") clearnTimeout(id) We can implement a contract t 阅读全文
posted @ 2020-09-29 19:12 Zhentiw 阅读(170) 评论(0) 推荐(0)
摘要: enum Sizes { Small = "small", Medium = "medium", Large = "large" } let selected: Sizes = Sizes.Samll; function updateSize(size: Sizes): void { selecte 阅读全文
posted @ 2020-09-29 15:24 Zhentiw 阅读(124) 评论(0) 推荐(0)
摘要: Let's say we have enum defined as such: export enum WeekDayEnum { sunday = 0, monday, tuseday, wednesday, thursday, friday, saturday, } export type Da 阅读全文
posted @ 2020-09-29 15:13 Zhentiw 阅读(171) 评论(0) 推荐(0)
摘要: Traversing items of custom data structures, like trees or linked lists, require knowledge of how that data structure is built. That can lead to proble 阅读全文
posted @ 2020-09-27 16:21 Zhentiw 阅读(217) 评论(0) 推荐(0)
摘要: This learning curve shows high error on the test sets but comparatively low error on training set, so the algorithm is suffering from high variance. T 阅读全文
posted @ 2020-09-27 03:30 Zhentiw 阅读(211) 评论(0) 推荐(0)
上一页 1 ··· 183 184 185 186 187 188 189 190 191 ··· 477 下一页