We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
//你的答案 我们需要从数组中获取所有的值,并将其作为新对象中的键和值。 这个使用索引类型很容易。我们可以通过使用 T[number]从数组中获取值。在映射类型的 帮助下,我们可以迭代 T[number]中的这些值,并返回一个新的类型,其中键和值 是 T[number]的类型: type TupleToObject<T extends readonly string[]> = { [K in T[number]]: K };
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: