3 ms·
I agree that it would be nice if it flagged this kind of thing. But TypeScript disagrees. https://github.com/microsoft/TypeScript/wiki/FAQ#why-are-functions-wi
by jjnoakes 3y ago
I agree that it would be nice if it flagged this kind of thing. But TypeScript disagrees.
https://github.com/microsoft/TypeScript/wiki/FAQ#why-are-functions-with-fewer-parameters-assignable-to-functions-that-take-more-parameters https://github.com/microsoft/TypeScript/wiki/FAQ#why-are-fun...
- wizofaus 3y agoInteresting but certainly disagree with the reasoning, that somehow having to explicitly discard the unused parameters would be "burdensome", certainly compared to the need to explicitly declare types for complex arbitrary data structures. If you're not even prepared to write, say, array.map((n, _, _) => parseInt(n)) then why bother using a strictly type checked language...
- jjnoakes 3y agoAgreed on all counts.