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

TypeScript Handbook - 4 - Creating Types from Types #357

Open
chochinlu opened this issue Jan 24, 2022 · 0 comments
Open

TypeScript Handbook - 4 - Creating Types from Types #357

chochinlu opened this issue Jan 24, 2022 · 0 comments

Comments

@chochinlu
Copy link
Owner

chochinlu commented Jan 24, 2022

https://www.typescriptlang.org/docs/handbook/2/types-from-types.html

Generic Constraints 約束

function loggingIdentity<Type>(arg: Type): Type {
  console.log(arg.length);
  return arg;
}

會收到抱怨: Property 'length' does not exist on type 'Type'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant