Nice little challenge, I wouldnt call it advanced tho, maybe more like intermediate?
Edit: heres another challenge: make a type Reverse which takes a tuple of any length and reverses its elements! (Hint: use the { 0: A; 1: B }[C extends D ? 0 : 1] hack to be able to use recursion in some cases where typescript woule've thrown an error)
I am Software Developer, currently interested in static type languages (TypeScript, Elm, ReScript) mostly in the frontend land, but working actively in Python also. I am available for mentoring.
I am Software Developer, currently interested in static type languages (TypeScript, Elm, ReScript) mostly in the frontend land, but working actively in Python also. I am available for mentoring.
Nice little challenge, I wouldnt call it advanced tho, maybe more like intermediate?
Edit: heres another challenge: make a type Reverse which takes a tuple of any length and reverses its elements! (Hint: use the
{ 0: A; 1: B }[C extends D ? 0 : 1]
hack to be able to use recursion in some cases where typescript woule've thrown an error)You are really picky :). I hope in the series I will put some questions which will satisfy you. Thanks for feedback.
Np, check the edit to the original comment to see a challenge idea
Nice one. Thank you!
Nice challenge :) Here are 2 solutions