Excellent explanation Anurag, thank you. I think the examples and the explanation helps me understand the typescript syntax a bit better and get used to it. Sometimes I find myself fighting with the VS Code type checker because I screw up the syntax!
Just as you describe in your last example, the same function looks very similar on plain JS. The ... function, decomposition and recursion are the ones doing all the magic here :)
Excellent explanation Anurag, thank you. I think the examples and the explanation helps me understand the typescript syntax a bit better and get used to it. Sometimes I find myself fighting with the VS Code type checker because I screw up the syntax!
Just as you describe in your last example, the same function looks very similar on plain JS. The
...
function, decomposition and recursion are the ones doing all the magic here :)Yes of course, once you get the mental model of type level programming it becomes a second nature. I'm glad you understood the post.