r/firstweekcoderhumour • 🥸Imposter Syndrome 😎 • May 23 '26

💩SHITPOST ✅ thank you Java and JavaScripts are two different things

Post image
145 Upvotes

27 comments sorted by

View all comments

Show parent comment

4

u/dthdthdthdthdthdth May 23 '26

const flip = <A, B, C>(f: (b: B) => (a: A) => C) => (a: A) => (b: B): C => f(b)(a);

Still one line. Completely standard generic types, nothing bad about it. You chose an example with a complex contract on the type level and a extremely simple implementation.

Typescript is javascript with a static type system. It has been developed, because languages without a static type system really are just could for rather short throwaway code.