上一页 1 ··· 162 163 164 165 166 167 168 169 170 ··· 491 下一页
摘要: function somethingRisky() {} try { somethingRisky() } catch(err: unknown) { if (err instanceof Error) { console.log(err.stack) } else { console.log(er 阅读全文
posted @ 2020-11-15 22:56 Zhentiw 阅读(88) 评论(0) 推荐(0)
摘要: Typescript v3.9 introduces the @ts-expect-error assertion added to TypeScript 3.9. This assertion is more descriptive than @ts-ignore because, rather 阅读全文
posted @ 2020-11-15 22:45 Zhentiw 阅读(1069) 评论(0) 推荐(0)
摘要: type Corner = `${'top' | 'bottom'}-${ 'left' | 'right'}` type VerticalAlignment = "top" | "middle" | "bottom"; type HorizontalAlignment = "left" | "ce 阅读全文
posted @ 2020-11-15 22:25 Zhentiw 阅读(177) 评论(0) 推荐(0)
摘要: ...T: type Foo<T extends any[]> = [boolean, ...T, boolean] In previous typescript version, you can only put '...T' to the last element of array. Put n 阅读全文
posted @ 2020-11-15 22:19 Zhentiw 阅读(123) 评论(0) 推荐(0)
摘要: class Foo { #name; constructor(rawName?: string) { this.#name = rawName ?? (no name) } log() { console.log(this.#name) } } Checking 'rawName' is nulli 阅读全文
posted @ 2020-11-14 18:11 Zhentiw 阅读(112) 评论(0) 推荐(0)
摘要: Volta’s job is to manage your JavaScript command-line tools, such as node, npm, yarn, or executables shipped as part of JavaScript packages. Similar t 阅读全文
posted @ 2020-11-14 18:00 Zhentiw 阅读(114) 评论(0) 推荐(0)
摘要: First, let's see the code: // builder/Contact.java public class Contact { private String firstName; private String lastName; private String emailAddre 阅读全文
posted @ 2020-11-13 15:43 Zhentiw 阅读(96) 评论(0) 推荐(0)
摘要: It's common for a user to enter values that you want to check against your pre-defined values. Let's make a demo of a word game to demonstrate one app 阅读全文
posted @ 2020-11-12 15:56 Zhentiw 阅读(144) 评论(0) 推荐(0)
摘要: Coding again the interface. interface: package com.frankmoley.lil.designpatternsapp.factory; public interface Pet { void setName(String name); String 阅读全文
posted @ 2020-11-11 17:38 Zhentiw 阅读(129) 评论(0) 推荐(0)
摘要: In previous post, we have follow code: const delayMessage = (message) => hardCode(message)(createTimeout(1000)); const sequence = (...broadcasters) => 阅读全文
posted @ 2020-11-11 16:46 Zhentiw 阅读(129) 评论(0) 推荐(0)
上一页 1 ··· 162 163 164 165 166 167 168 169 170 ··· 491 下一页