Get the latest tech news
Python-Style Kwargs in TypeScript
A pain-free way to write expressive, readable typed option bags in TypeScript.
Those floating undefined s are also impossible to reason about unless your development environment can show you the underlying argument names. Python's solution is to let callers specify the names of arguments (which is why they're called k ey w ord args, since they're specified by their keyword): Typed option bags lke this are one of my favorite TypeScript patterns, but I don't feel like I see it often.
Or read this on Hacker News