3 ms·
Which is exactly what was used in the code exemplifying something else in the second example - so that confused me (never having written any TS) too.
by OJFord 5y ago
Which is exactly what was used in the code exemplifying something else in the second example - so that confused me (never having written any TS) too.
- throwanem 5y agoYeah, typically you want a record type for something like a mapping over potentially arbitrary keys (via an index type) to values of known type, and an object type (which can have optional keys) when you do know exactly what shape you expect and want to enforce it.