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
Thanks for writing this great book. I'm new to TypeScript and I'm enjoying working through it.
I noticed that the answer to Chapter 4 Exercise 5 has the function signature:
function is<T>(a: T, ...b: [T, ...T[]]): boolean
However, when I was attempting it on my own, I came up with:
function is<T>(a: T, ...b: T[]): boolean
which also seems to work. It looks like there's also an open PR (#8) with the signature:
function is<T>(a: T, ...b: [...T[]]): boolean
What's the difference, if any, between these different generic types?
The text was updated successfully, but these errors were encountered:
I came here to ask the same question.
Sorry, something went wrong.
Just noticed the question was answer on the PR. The reason is to avoid users calling is('a') with a single argument.
is('a')
No branches or pull requests
Thanks for writing this great book. I'm new to TypeScript and I'm enjoying working through it.
I noticed that the answer to Chapter 4 Exercise 5 has the function signature:
However, when I was attempting it on my own, I came up with:
which also seems to work. It looks like there's also an open PR (#8) with the signature:
What's the difference, if any, between these different generic types?
The text was updated successfully, but these errors were encountered: