Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wouldn't the following sample code be better? (タプル型の例としては異なる型のペアのほうが例として好ましくないですか?) #849

Open
RHxyz009abc opened this issue Mar 14, 2024 · 1 comment
Labels
stage1:話し合い中 結論を出すために話し合いをしている最中です。まだ着手・プルリクエストの作成はしないでください。

Comments

@RHxyz009abc
Copy link

RHxyz009abc commented Mar 14, 2024

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];

type Point2D = [number, number];

Wouldn't the following sample code be better?
type Point2D = [number, string];

@suin suin changed the title Wouldn't the following sample code be better? Wouldn't the following sample code be better? (タプル型の例としては異なる型のペアのほうが例として好ましくないですか?) Mar 22, 2024
@suin suin added the stage1:話し合い中 結論を出すために話し合いをしている最中です。まだ着手・プルリクエストの作成はしないでください。 label Mar 22, 2024
@suin
Copy link
Contributor

suin commented 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.

ja: たしかに!異なる型同士のほうが、タプル型らしさが出ますね。Point2Dがstringを持つのは不自然なので、例を大きく変える必要はありそうですね。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage1:話し合い中 結論を出すために話し合いをしている最中です。まだ着手・プルリクエストの作成はしないでください。
Projects
None yet
Development

No branches or pull requests

2 participants