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
题目链接:Concat
实现 Concat ,它接收两个参数,两个参数的类型都是数组,将两个数组进行连接,并返回它。
Concat
import type { Equal, Expect } from "@type-challenges/utils"; type cases = [ Expect<Equal<Concat<[], []>, []>>, Expect<Equal<Concat<[], [1]>, [1]>>, Expect<Equal<Concat<[1, 2], [3, 4]>, [1, 2, 3, 4]>>, Expect< Equal< Concat<["1", 2, "3"], [false, boolean, "4"]>, ["1", 2, "3", false, boolean, "4"] > > ];
type Concat<T extends readonly unknown[], F extends readonly unknown[]> = [ ...T, ...U ];
The text was updated successfully, but these errors were encountered:
No branches or pull requests
题目
题目链接:Concat
实现
Concat
,它接收两个参数,两个参数的类型都是数组,将两个数组进行连接,并返回它。答案
方法一
The text was updated successfully, but these errors were encountered: