Our great sponsors
-
proposal-record-tuple
ECMAScript proposal for the Record and Tuple value types. | Stage 2: it will change!
-
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.
The underlying problem is that JavaScript has poor support for data. Data structures should have immutable definitions and not be extendable (no inheritance). We use Objects to store data because we have no other choice. The Records and Tuples proposal should give us more options hopefully.
Rather than calling it "broken", you might identify additional reasons why it must be that way, such as TS lacking exact types (which could prevent extra keys via structural compatibility) and lacking sealed classes (which could prevent extra keys from inheritance).
Related posts
- Why doesn't TypeScript properly type Object.keys?
- Future Javascript: Records and Tuples
- Typescript says object is possibly 'undefined' for an object property, even after checking/narrowing if the property exists.
- All I Want for Christmas Is These Seven TypeScript Improvements
- JSR Is Not Another Package Manager