Why does this compile cleanly in TypeScript, but crash when called with no arguements? Go!

11 405
27.7
Следующее
128 дней – 9 48744:44
How to build AI agents with memory
Популярные
20 дней – 3 6250:32
Android vs. Dog (which one will win)
Опубликовано 6 октября 2025, 13:01
Here’s a TypeScript developer challenge that shows how optional parameters can get tricky. TypeScript accepts the code without errors. But the moment you call the function with no arguments, it blows up at runtime. Why does this compile cleanly, and what change would you make so the bug is caught during type checking instead of in production? Share your solution in the comments.

Subscribe to Google for Developers → goo.gle/developers

Speakers: Meg Bauman
автотехномузыкадетское