diff --git a/src/ch04/exercises.ts b/src/ch04/exercises.ts index 9cb666a..fe37251 100644 --- a/src/ch04/exercises.ts +++ b/src/ch04/exercises.ts @@ -86,6 +86,6 @@ is(10, 'foo') // Error TS2345: Argument of type '"foo"' is not assignable // [Hard] I should be able to pass any number of arguments is([1], [1, 2], [1, 2, 3]) // false -function is(a: T, ...b: [T, ...T[]]): boolean { +function is(a: T, ...b: [...T[]]): boolean { return b.every(_ => _ === a) }