You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Features of TypeScript.
Advanced type expression.
2. Tuple type: A type that allows you to specify a different type for each element of the array.
type Point2D = [number, number];
Wouldn't the following sample code be better?
type Point2D = [number, string];
The text was updated successfully, but these errors were encountered:
suin
changed the title
Wouldn't the following sample code be better?
Wouldn't the following sample code be better? (タプル型の例としては異なる型のペアのほうが例として好ましくないですか?)
Mar 22, 2024
Certainly! Having different types in a tuple indeed showcases the unique capability of tuple types more effectively. However, including a string in Point2D might seem unnatural, suggesting that a significant change to the example could be beneficial.
Features of TypeScript.
Advanced type expression.
2. Tuple type: A type that allows you to specify a different type for each element of the array.
type Point2D = [number, number];
book/docs/overview/features.md
Line 56 in 93c3a5c
Wouldn't the following sample code be better?
type Point2D = [number, string];
The text was updated successfully, but these errors were encountered: