basarat / basarat/typescript-book
Record Type
- Dominant language
- TypeScript
- Stars
- 21.6k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
# Record
Record allows you to create simple object bag definitions taking in two generic arguments (key and value).
As an example, at a simple level `Record` is same as `{[key:string]:string}`.
However because of the placement of the generic argument it can help with creating typesafe maps very conveniently e.g. `Record`. You can do the equivalent with mapped types i.e. `{ [P in Something]: string }` but the record version reads easier :rose:
Contributor guide
Research direction
Start by locating the book section where TypeScript object, generic, or mapped types are documented; the issue provides the Record examples to use as context. Add a concise explanation of Record and its mapped-type equivalent, then verify that the new documentation fits the surrounding section and examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100