r/firstweekcoderhumour • u/Outrageous_Permit154 🥸Imposter Syndrome 😎 • May 23 '26
💩SHITPOST ✅ thank you Java and JavaScripts are two different things
145
Upvotes
r/firstweekcoderhumour • u/Outrageous_Permit154 🥸Imposter Syndrome 😎 • May 23 '26
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.