|
|
|
|
|
by throwanem
1709 days ago
|
|
The third example describes something useful in record types, but goes about it in what seems an odd way, and ends up suboptimal as a result. I'd instead use an object type like this: type Human = {
name: string;
age: number;
}
which also enforces value types in the compiler, rather than requiring runtime guards. |
|