Open Mantou1233 opened 1 year ago
this isnt a hard one but really requires thinking
The solution is really nice, but it is not strict enough: it allows things like
curried1('123')(123)('anything')
@Mantou1233 ~Can you please explain how your solution works? I'm really baffled here...~ Never mind. Eventually figure out. Problem with this solution though is that it doesn't enforce types on each function call. For example:
const curried1 = DynamicParamsCurrying(
(a: string, b: number, c: boolean) => true
);
const test = curried1(true, true, true) // <-- This looks valid! No squiggly lines here!
The example above ☝️ shouldn't be the case. @Alexsey was right all along.