Our great sponsors
-
typescript-book
The Concise TypeScript Book: A Concise Guide to Effective Development in TypeScript. Free and Open Source. (by gibbok)
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
One thing I’ve never found a name for (and, as a result, a good way to reference to people) is Typescript’s interesting behaviour around the Erased Structural Types mentioned here: https://github.com/gibbok/typescript-book#erased-structural-....
Objects passed to a function that accepts an object type can generally have more properties that needed given Typescript’s structural typing. That is unless you pass a literal directly to the function (I.e. inline the obj variable in the linked example). In which case Typescript will complain about the excess properties. Ergonomic but confusing the first time you come across it.
Honestly the TC39 is the best case scenario. https://tc39.es/proposal-type-annotations/
Forget runtime type validation, TS is really for preventing bugs at development time as well as IDE integration.