zenn.dev/t_keshi/articles/tips-typescript-1
1 Users
0 Comments
2 Highlights
0 Notes
Tags
Top Highlights
A extends B ? C : Dという形式で、条件分岐のロジックをもった型を作れる A extends Bが条件にあたる Cは真の場合に返す型 Dは偽の場合に返す型
type Vehicle = "motorbike" | "car" | "train" "musume-chan" extends Vehicle ? true : false // → false
Glasp is a social web highlighter that people can highlight and organize quotes and thoughts from the web, and access other like-minded people’s learning.