曲中作樂,以曲為生
Typescript小貼士:Type Guard
Array Manipulation 經常用到 `filter()` 但 typescript 唔會幫你 infer 個 output type,所以好多時都要用 `as` 去 override 個 type, 但最好嘅方法係用 type guard function 去比 hint typescript。
https://littlecodeguy.com/post/2022-08-02-arr-type-guard/…
喜欢我的文章吗?
别忘了给点支持与赞赏,让我知道创作的路上有你陪伴。
发布评论…