Alex Grad @grad.dev · Dec 13

I've completed day 13 of #AdventOfTypeScript. Today's task was actually pretty easy. You just need to add `in out` before `T`. adventofts.com/events/2024/13

16 likes 5 replies

?

Replies

Alex Grad · Dec 13

Alternatively, here's another way to solve it:

oqx 🎷 · Dec 16

I spent hours scratching my head on this one. Need to step up my TS game!

ArttX · Dec 13

I could not figure it out by myself. I even did not know, that this exists in Typescript. Found some articles about his topic. Found, that there is `in out` in generics. Used that. It worked. Still do not understand, how it works, but if it works, it works.

Tomasz Gil · Dec 13

It wasn't particularly easy for me - I was familiar with the terms (though they're still confusing), but I had no idea that you can just annotate them. Pretty fun! www.typescriptlang.org/docs/handboo...

Ganesh R · Dec 14

Did not know this was a thing, could not find anything in docs too. Could you share any links to learn more about this?