Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

But this is exactly what the article is about? I don't know what you mean by "option object" but it doesn't sound any more conventional than union types to me.


What I meant by option objects is a dictionary object holding all parameters.

doStuff({userId: foo, itemId: bar});

This allows the order of key/val pairs to move around, making it more robust to mistakes than doStuff: (string,string) => void.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: