You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First. Typescript expects the most specific first and the most generic last. The generic last is for general fall back and because that is the typedef that gets passed if you pass the function as an argument
Second, typescript tries to match first defined. This means that it will find export function splitEvery(a: number): (list: string) => string[] first, and splitEvery(2)([1,2,3,4,5,6]) will never be allowed. Because [1,2,3,4,5,6]. Typescript will not go back and look for the other def export function splitEvery<T>(a: number): (list: readonly T[]) => T[][]; to match what you're trying to give it
splitEvery
takes 2 arguments and is curried so the following is possible:However, your types are messed up making it hard to work with in TS:
Should be corrected to:
The text was updated successfully, but these errors were encountered: