4 ms·
> I'm a bit surprised Typescript never added them TypeScript's pretty insistent on not adding features to the language that can't be "compiled" just by strippi
by wk_end 3y ago
> I'm a bit surprised Typescript never added them
TypeScript's pretty insistent on not adding features to the language that can't be "compiled" just by stripping types away. There was a little bit of slack around this early on (enums, most notably) but these days something like named parameters would probably be a non-starter until/unless JS implemented them first.
- epicureanideal 3y agoAlso it’s easy enough to pass objects with named properties and destructure the object in the function parameters. So there’s no real need for named parameters anymore and it would just add another duplicative way of writing the same code.